Class DefaultLibraryIDPAttributeMapper
- java.lang.Object
-
- com.sun.identity.saml2.plugins.DefaultAttributeMapper
-
- com.sun.identity.saml2.plugins.DefaultLibraryIDPAttributeMapper
-
- All Implemented Interfaces:
IDPAttributeMapper
- Direct Known Subclasses:
DefaultAttributeMapper,DefaultIDPAttributeMapper
public class DefaultLibraryIDPAttributeMapper extends DefaultAttributeMapper implements IDPAttributeMapper
This classDefaultLibraryIDPAttributeMapperimplements theIDPAttributeMapperto return the SAMLAttributeobjects that may be inserted in the SAML Assertion. This IDP attribute mapper reads the attribute map configuration defined in the hosted IDP configuration and construct the SAMLAttributeobjects. If the mapped values are not present in the data store, this will try to read from the Single sign-on token.Supports attribute mappings defined as: [NameFormatURI|]SAML ATTRIBUTE NAME=["]LOCAL NAME["][;binary] where [] elements are optional. Using "" (double quotes) around the LOCAL NAME will turn it into a static value. Adding ;binary at the end of the LOCAL NAME will indicate that this attribute should be treated as binary and Base64 encoded.
Examples:
email=mailwill map the local attribute called mail onto a SAML attribute called email.urn:oasis:names:tc:SAML:2.0:attrname-format:uri|urn:mace:dir:attribute-def:cn=cnwill map the local attribute called cn onto a SAML attribute called urn:mace:dir:attribute-def:cn with a name format of urn:oasis:names:tc:SAML:2.0:attrname-format:uripartnerID="staticPartnerIDValue"will add a static SAML attribute called partnerID with a value of staticPartnerIDValueurn:oasis:names:tc:SAML:2.0:attrname-format:uri|nameID="staticNameIDValue"will add a static SAML attribute called nameID with a value of staticNameIDValue with a name format of urn:oasis:names:tc:SAML:2.0:attrname-format:uriobjectGUID=objectGUID;binarywill map the local binary attribute called objectGUID onto a SAML attribute called objectGUID Base64 encoded.urn:oasis:names:tc:SAML:2.0:attrname-format:uri|objectGUID=objectGUID;binarywill map the local binary attribute called objectGUID onto a SAML attribute called objectGUID Base64 encoded with a name format of urn:oasis:names:tc:SAML:2.0:attrname-format:uri.
-
-
Field Summary
-
Fields inherited from class com.sun.identity.saml2.plugins.DefaultAttributeMapper
bundle, debug, dsProvider, IDP, SP
-
-
Constructor Summary
Constructors Constructor Description DefaultLibraryIDPAttributeMapper()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListgetAttributes(Object session, String hostEntityID, String remoteEntityID, String realm)Returns list of SAMLAttributeobjects for the IDP framework to insert into the generatedAssertion.protected AttributegetSAMLAttribute(String name, String nameFormat, Set<String> values, String hostEntityID, String remoteEntityID, String realm)Returns the SAMLAttributeobject.protected booleanisIgnoredProfile(Object session, String realm)Return true if ignore profile is enabled for this realm.protected booleanneedToEscapeXMLSpecialCharacters(String hostEntityID, String remoteEntityID, String realm)Decides whether it needs to escape XML special characters for attribute values or not.-
Methods inherited from class com.sun.identity.saml2.plugins.DefaultAttributeMapper
getConfigAttributeMap
-
-
-
-
Method Detail
-
getAttributes
public List getAttributes(Object session, String hostEntityID, String remoteEntityID, String realm) throws SAML2Exception
Returns list of SAMLAttributeobjects for the IDP framework to insert into the generatedAssertion.- Specified by:
getAttributesin interfaceIDPAttributeMapper- Parameters:
session- Single sign-on session.hostEntityID-EntityIDof the hosted entity.remoteEntityID-EntityIDof the remote entity.realm- name of the realm.- Returns:
- list of
Attributess of an authenticated user. - Throws:
SAML2Exception- if any failure.
-
needToEscapeXMLSpecialCharacters
protected boolean needToEscapeXMLSpecialCharacters(String hostEntityID, String remoteEntityID, String realm)
Decides whether it needs to escape XML special characters for attribute values or not.- Parameters:
hostEntityID- Entity ID for hosted provider.remoteEntityID- Entity ID for remote provider.realm- the providers are in.- Returns:
trueif it should escape special characters for attribute values;falseotherwise.
-
getSAMLAttribute
protected Attribute getSAMLAttribute(String name, String nameFormat, Set<String> values, String hostEntityID, String remoteEntityID, String realm) throws SAML2Exception
Returns the SAMLAttributeobject.- Parameters:
name- attribute name.nameFormat- Name format of the attributevalues- attribute values.hostEntityID- Entity ID for hosted provider.remoteEntityID- Entity ID for remote provider.realm- the providers are in.- Returns:
- SAML
Attributeelement. - Throws:
SAML2Exception- if any failure.
-
isIgnoredProfile
protected boolean isIgnoredProfile(Object session, String realm)
Return true if ignore profile is enabled for this realm.- Parameters:
session- SSOToken to check the profile creation attributes.realm- realm to check the profile creation attributes.- Returns:
- true in all cases in this implementation.
-
-