Class SamlPrincipal

java.lang.Object
org.keycloak.adapters.saml.SamlPrincipal
All Implemented Interfaces:
Serializable, Principal

public class SamlPrincipal extends Object implements Serializable, Principal
Version:
$Revision: 1 $
Author:
Bill Burke
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getAssertion

      public AssertionType getAssertion()
      Get full saml assertion
      Returns:
    • getSamlSubject

      public String getSamlSubject()
      Get SAML subject sent in assertion
      Returns:
    • getNameIDFormat

      public String getNameIDFormat()
      Subject nameID format
      Returns:
    • getNameID

      public NameIDType getNameID()
      Subject nameID format
      Returns:
    • getAssertionDocument

      public Document getAssertionDocument()
    • getName

      public String getName()
      Specified by:
      getName in interface Principal
    • getAttributes

      public List<String> getAttributes(String name)
      Convenience function that gets Attribute value by attribute name
      Parameters:
      name -
      Returns:
    • getAttributes

      public Map<String,List<String>> getAttributes()
      Convenience function that gets the attributes associated with this principal
      Returns:
      attributes associated with this principal
    • getFriendlyAttributes

      public List<String> getFriendlyAttributes(String friendlyName)
      Convenience function that gets Attribute value by attribute friendly name
      Parameters:
      friendlyName -
      Returns:
    • getAttribute

      public String getAttribute(String name)
      Convenience function that gets first value of an attribute by attribute name
      Parameters:
      name -
      Returns:
    • getFriendlyAttribute

      public String getFriendlyAttribute(String friendlyName)
      Convenience function that gets first value of an attribute by attribute name
      Parameters:
      friendlyName -
      Returns:
    • getAttributeNames

      public Set<String> getAttributeNames()
      Get set of all assertion attribute names
      Returns:
    • getFriendlyNames

      public Set<String> getFriendlyNames()
      Get set of all assertion friendly attribute names
      Returns:
    • equals

      public boolean equals(Object other)
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class Object