Package org.keycloak.adapters.saml
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_ROLE_ATTRIBUTE_NAME
-
Constructor Summary
Constructors Constructor Description SamlPrincipal()SamlPrincipal(AssertionType assertion, String name, String samlSubject, String nameIDFormat, MultivaluedHashMap<String,String> attributes, MultivaluedHashMap<String,String> friendlyAttributes)SamlPrincipal(AssertionType assertion, Document assertionDocument, String name, String samlSubject, String nameIDFormat, MultivaluedHashMap<String,String> attributes, MultivaluedHashMap<String,String> friendlyAttributes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)AssertionTypegetAssertion()Get full saml assertionDocumentgetAssertionDocument()StringgetAttribute(String name)Convenience function that gets first value of an attribute by attribute nameSet<String>getAttributeNames()Get set of all assertion attribute namesMap<String,List<String>>getAttributes()Convenience function that gets the attributes associated with this principalList<String>getAttributes(String name)Convenience function that gets Attribute value by attribute nameStringgetFriendlyAttribute(String friendlyName)Convenience function that gets first value of an attribute by attribute nameList<String>getFriendlyAttributes(String friendlyName)Convenience function that gets Attribute value by attribute friendly nameSet<String>getFriendlyNames()Get set of all assertion friendly attribute namesStringgetName()NameIDTypegetNameID()Subject nameID formatStringgetNameIDFormat()Subject nameID formatStringgetSamlSubject()Get SAML subject sent in assertioninthashCode()
-
-
-
Field Detail
-
DEFAULT_ROLE_ATTRIBUTE_NAME
public static final String DEFAULT_ROLE_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SamlPrincipal
public SamlPrincipal(AssertionType assertion, String name, String samlSubject, String nameIDFormat, MultivaluedHashMap<String,String> attributes, MultivaluedHashMap<String,String> friendlyAttributes)
-
SamlPrincipal
public SamlPrincipal(AssertionType assertion, Document assertionDocument, String name, String samlSubject, String nameIDFormat, MultivaluedHashMap<String,String> attributes, MultivaluedHashMap<String,String> friendlyAttributes)
-
SamlPrincipal
public SamlPrincipal()
-
-
Method Detail
-
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()
-
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)
-
-