Class SamlPrincipal

java.lang.Object
org.apache.catalina.realm.GenericPrincipal
org.exoplatform.addons.saml.extensions.SamlPrincipal
All Implemented Interfaces:
Serializable, Principal, org.apache.catalina.TomcatPrincipal

public class SamlPrincipal extends org.apache.catalina.realm.GenericPrincipal
The principal of a user authenticated through the SAML workflow.

Tomcat's single sign-on valve keeps the principal of a login and gives it back to the next portal session of the same browser. The marker in the portal session is lost with that session, so the type of the principal is what still tells a SAML login when the valve signs the user back in. See SamlServiceProviderAuthenticator and HybridSAML2LogoutFilter.isSamlSession(HttpServletRequest).

The name is the eXo username, after the mapping of the valve (e-mail to username, lower case). The subject is what the IDP sent: the SAML logout asks the IDP to end the session of that subject, not of the eXo username.

See Also:
  • Field Summary

    Fields inherited from class org.apache.catalina.realm.GenericPrincipal

    attributes, gssCredential, loginContext, name, roles, userPrincipal
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    SamlPrincipal(String name, List<String> roles, String subject)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     

    Methods inherited from class org.apache.catalina.realm.GenericPrincipal

    equals, getAttribute, getAttributeNames, getGssCredential, getName, getRoles, getUserPrincipal, hashCode, hasRole, logout, setGssCredential, toString

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface Principal

    implies
  • Constructor Details

    • SamlPrincipal

      public SamlPrincipal(String name, List<String> roles)
    • SamlPrincipal

      public SamlPrincipal(String name, List<String> roles, String subject)
      Parameters:
      name - the eXo username
      roles - the roles of the user
      subject - the subject sent by the IDP, or null when it is the name
  • Method Details

    • getSubject

      public String getSubject()
      Returns:
      the subject sent by the IDP (the NameID, or the value of the subject attribute), or the name when it is not known