public class DefaultLibraryIDPAttributeMapper extends DefaultAttributeMapper implements IDPAttributeMapper
DefaultLibraryIDPAttributeMapper
implements the
IDPAttributeMapper
to return the SAML Attribute
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 SAML
Attribute
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:uri
partnerID="staticPartnerIDValue"
will add a static SAML attribute called partnerID with a value of staticPartnerIDValue
urn: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:uri
objectGUID=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.
bundle, debug, dsProvider, IDP, SP
Constructor and Description |
---|
DefaultLibraryIDPAttributeMapper()
Constructor
|
Modifier and Type | Method and Description |
---|---|
List |
getAttributes(Object session,
String hostEntityID,
String remoteEntityID,
String realm)
Returns list of SAML
Attribute objects for the
IDP framework to insert into the generated Assertion . |
protected Attribute |
getSAMLAttribute(String name,
String nameFormat,
Set<String> values,
String hostEntityID,
String remoteEntityID,
String realm)
Returns the SAML
Attribute 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.
|
getConfigAttributeMap
public DefaultLibraryIDPAttributeMapper()
public List getAttributes(Object session, String hostEntityID, String remoteEntityID, String realm) throws SAML2Exception
Attribute
objects for the
IDP framework to insert into the generated Assertion
.getAttributes
in interface IDPAttributeMapper
session
- Single sign-on session.hostEntityID
- EntityID
of the hosted entity.remoteEntityID
- EntityID
of the remote entity.realm
- name of the realm.Attributes
s of an authenticated user.SAML2Exception
- if any failure.protected boolean needToEscapeXMLSpecialCharacters(String hostEntityID, String remoteEntityID, String realm)
hostEntityID
- Entity ID for hosted provider.remoteEntityID
- Entity ID for remote provider.realm
- the providers are in.true
if it should escape special characters for
attribute values; false
otherwise.protected Attribute getSAMLAttribute(String name, String nameFormat, Set<String> values, String hostEntityID, String remoteEntityID, String realm) throws SAML2Exception
Attribute
object.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.Attribute
element.SAML2Exception
- if any failure.protected boolean isIgnoredProfile(Object session, String realm)
session
- SSOToken to check the profile creation attributes.realm
- realm to check the profile creation attributes.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.