BrightSide Workbench Full Report + Source Code
org.turro.sso.AssertionProvider Class Reference
Inheritance diagram for org.turro.sso.AssertionProvider:
Collaboration diagram for org.turro.sso.AssertionProvider:

Public Member Functions

boolean hasAssertion (HttpServletRequest request)
 
void killAssertion (HttpServletResponse response)
 
ISSOIdentity getAssertion (HttpServletRequest request)
 
void setAssertion (byte[] assertion, byte[] clientId, IContact contact, String details, String remoteIP, String geoIP, HttpServletResponse response)
 
void updateAssertion (String details, String remoteIP, String geoIP, HttpServletResponse response, ISSOIdentity identity)
 
void removeAssertion (HttpServletRequest request, HttpServletResponse response, IContact contact)
 
String getGeoIP (String remoteIP)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 47 of file AssertionProvider.java.

Member Function Documentation

◆ getAssertion()

ISSOIdentity org.turro.sso.AssertionProvider.getAssertion ( HttpServletRequest  request)

Implements org.turro.elephant.sso.IAssertionProvider.

Definition at line 63 of file AssertionProvider.java.

63  {
64  Cookie assertion = CookieUtil.getCookie(request, ASSERTION_ID);
65  if(assertion != null) {
66  try {
67  Dao dao = new ElephantPU();
68  return dao.find(SSOIdentity.class, new String(CookieUtil.decryptCookieValue(assertion), StandardCharsets.UTF_8));
69  } catch (IOException | DecoderException ex) {
70  Logger.getLogger(AssertionProvider.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
71  }
72  }
73  return null;
74  }
Here is the call graph for this function:

◆ getGeoIP()

String org.turro.sso.AssertionProvider.getGeoIP ( String  remoteIP)

Implements org.turro.elephant.sso.IAssertionProvider.

Definition at line 114 of file AssertionProvider.java.

114  {
115  return SqlClause.select("max(geoIp)").from("SSOIdentity")
116  .where().equal("remoteIp", remoteIP)
117  .dao(new ElephantPU()).singleResult(String.class);
118  }

◆ hasAssertion()

boolean org.turro.sso.AssertionProvider.hasAssertion ( HttpServletRequest  request)

Implements org.turro.elephant.sso.IAssertionProvider.

Definition at line 53 of file AssertionProvider.java.

53  {
54  return CookieUtil.getCookie(request, ASSERTION_ID) != null;
55  }
Here is the call graph for this function:

◆ killAssertion()

void org.turro.sso.AssertionProvider.killAssertion ( HttpServletResponse  response)

Implements org.turro.elephant.sso.IAssertionProvider.

Definition at line 58 of file AssertionProvider.java.

58  {
59  CookieUtil.deleteCookie(response, ASSERTION_ID, "/");
60  }
Here is the call graph for this function:

◆ removeAssertion()

void org.turro.sso.AssertionProvider.removeAssertion ( HttpServletRequest  request,
HttpServletResponse  response,
IContact  contact 
)

Implements org.turro.elephant.sso.IAssertionProvider.

Definition at line 102 of file AssertionProvider.java.

102  {
103  CookieUtil.deleteCookie(response, ASSERTION_ID, "/");
104  WhereClause wc = new WhereClause();
105  wc.addClause("delete from SSOIdentity");
106  wc.addClause("where idContact = :id");
107  wc.addNamedValue("id", contact.getId());
108  wc.addClause("and clientId = :client");
109  wc.addNamedValue("client", SSO.getSSO().getCurrentId(request));
110  new ElephantPU().executeUpdate(wc);
111  }
Here is the call graph for this function:

◆ setAssertion()

void org.turro.sso.AssertionProvider.setAssertion ( byte[]  assertion,
byte[]  clientId,
IContact  contact,
String  details,
String  remoteIP,
String  geoIP,
HttpServletResponse  response 
)

Implements org.turro.elephant.sso.IAssertionProvider.

Definition at line 77 of file AssertionProvider.java.

78  {
79  if(assertion != null) {
80  SSOIdentity identity = new SSOIdentity();
81  identity.setClientAssertion(assertion);
82  identity.setClientId(clientId);
83  identity.setContact(contact);
84  updateAssertion(details, remoteIP, geoIP, response, identity);
85  }
86  }
void updateAssertion(String details, String remoteIP, String geoIP, HttpServletResponse response, ISSOIdentity identity)
Here is the call graph for this function:

◆ updateAssertion()

void org.turro.sso.AssertionProvider.updateAssertion ( String  details,
String  remoteIP,
String  geoIP,
HttpServletResponse  response,
ISSOIdentity  identity 
)

Implements org.turro.elephant.sso.IAssertionProvider.

Definition at line 89 of file AssertionProvider.java.

89  {
90  if(identity != null) {
91  CookieUtil.encryptCookie(response, ASSERTION_ID, identity.getClientAssertion(), "/", VALID_DAYS*24*60*60);
92  ((SSOIdentity) identity).setDateUsed(new Date());
93  ((SSOIdentity) identity).setDetails(details);
94  ((SSOIdentity) identity).setRemoteIp(remoteIP);
95  ((SSOIdentity) identity).setGeoIp(geoIP);
96  new ElephantPU().saveObject(identity);
97  removeOldAssertions();
98  }
99  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: