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 classDefaultLibraryIDPAttributeMapper
implements theIDPAttributeMapper
to return the SAMLAttribute
objects 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 SAMLAttribute
objects. 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=mail
will 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=cn
will 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;binary
will 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;binary
will 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 List
getAttributes(Object session, String hostEntityID, String remoteEntityID, String realm)
Returns list of SAMLAttribute
objects for the IDP framework to insert into the generatedAssertion
.protected Attribute
getSAMLAttribute(String name, String nameFormat, Set<String> values, String hostEntityID, String remoteEntityID, String realm)
Returns the SAMLAttribute
object.protected boolean
isIgnoredProfile(Object session, String realm)
Return true if ignore profile is enabled for this realm.protected boolean
needToEscapeXMLSpecialCharacters(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 SAMLAttribute
objects for the IDP framework to insert into the generatedAssertion
.- Specified by:
getAttributes
in interfaceIDPAttributeMapper
- Parameters:
session
- Single sign-on session.hostEntityID
-EntityID
of the hosted entity.remoteEntityID
-EntityID
of the remote entity.realm
- name of the realm.- Returns:
- list of
Attributes
s 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:
true
if it should escape special characters for attribute values;false
otherwise.
-
getSAMLAttribute
protected Attribute getSAMLAttribute(String name, String nameFormat, Set<String> values, String hostEntityID, String remoteEntityID, String realm) throws SAML2Exception
Returns the SAMLAttribute
object.- 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
Attribute
element. - 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.
-
-