Class IdpAttributeMapperScriptHelper
- java.lang.Object
- 
- com.sun.identity.saml2.plugins.scripted.IdpAttributeMapperScriptHelper
 
- 
 @EvolvingAll public class IdpAttributeMapperScriptHelper extends Object This class exposes methods that are only intended to be used by IDP Attribute Mapper script types.
- 
- 
Constructor SummaryConstructors Constructor Description IdpAttributeMapperScriptHelper()Construct a new instance ofIdpAttributeMapperScriptHelper.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributecreateSAMLAttribute(String name, String nameFormat, Set<String> values)Create a SAMLAttributeobject.Map<String,Set<String>>getAttributes(Object session, Set<String> attrNames)Get attributes from a session.Map<String,byte[][]>getBinaryAttributes(Object session, Set<String> attrNames)Get binary attributes from a session.Set<String>getBinaryAttributeValues(String samlAttribute, String localAttribute, Map<String,byte[][]> binaryValueMap)Return a Set of Base64 encoded String values that represent the binary attribute values.Map<String,String>getHostedIDPConfigAttributeMap(String realm, String hostedEntityId)Return the attribute map by parsing the configured map in hosted identity provider configuration.Set<String>getPropertySet(Object session, String property)Return the property value of a session object.Map<String,String>getRemoteSPConfigAttributeMap(String realm, String remoteEntityId)Return the attribute map by parsing the configured map in remote service provider configurationbooleanisBinaryAttribute(String attributeName)For the given attributeName, return true if it is flagged as a binary attribute.booleanisIgnoredProfile(Object session, String realm)Return true if ignore profile is enabled for this realm.booleanisSessionValid(Object session)Check if a session is valid.booleanisStaticAttribute(String attributeName)For the given attributeName, return true if it is flagged as an attribute.StringremoveBinaryAttributeFlag(String attributeName)Return the attributeName without the binary flag if it is included.StringremoveStaticAttributeFlag(String attributeName)Return the attributeName without the flag if it is included.
 
- 
- 
- 
Constructor Detail- 
IdpAttributeMapperScriptHelperpublic IdpAttributeMapperScriptHelper() Construct a new instance ofIdpAttributeMapperScriptHelper.
 
- 
 - 
Method Detail- 
isSessionValidpublic boolean isSessionValid(Object session) throws SessionException Check if a session is valid. This is useful for toolkit clean-up thread.- Parameters:
- session- Session object.
- Returns:
- true if the session is valid.
- Throws:
- SessionException- the session exception
 
 - 
getHostedIDPConfigAttributeMappublic Map<String,String> getHostedIDPConfigAttributeMap(String realm, String hostedEntityId) throws SAML2Exception Return the attribute map by parsing the configured map in hosted identity provider configuration.- Parameters:
- realm- realm name.
- hostedEntityId- the hosted entity identity.
- Returns:
- a map of local attributes configuration map. This map will have a key as the SAML attribute name and the value is the local attribute.
- Throws:
- SAML2Exception- if any failure.
 
 - 
getRemoteSPConfigAttributeMappublic Map<String,String> getRemoteSPConfigAttributeMap(String realm, String remoteEntityId) throws SAML2Exception Return the attribute map by parsing the configured map in remote service provider configuration- Parameters:
- realm- realm name.
- remoteEntityId- the remote entity identity.
- Returns:
- a map of local attributes configuration map. This map will have a key as the SAML attribute name and the value is the local attribute.
- Throws:
- SAML2Exception- if any failure.
 
 - 
isIgnoredProfilepublic 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 if ignore profile is enabled, false otherwise.
 
 - 
getPropertySetpublic Set<String> getPropertySet(Object session, String property) throws SessionException Return the property value of a session object.- Parameters:
- session- the session
- property- the property name
- Returns:
- the property set
- Throws:
- SessionException- on failing to get the datastore provider or reading the value from the datastore.
 
 - 
getAttributespublic Map<String,Set<String>> getAttributes(Object session, Set<String> attrNames) throws SAML2Exception, DataStoreProviderException, SessionException Get attributes from a session.- Parameters:
- session- the session
- attrNames- the attr names
- Returns:
- the attributes from session
- Throws:
- SAML2Exception- on failing to get the datastore provider and on failing to read attributes from the datastore provider.
- SessionException- on failing to get the session provider.
- DataStoreProviderException- on failing to read the binary attributes from the datastore provider.
 
 - 
getBinaryAttributespublic Map<String,byte[][]> getBinaryAttributes(Object session, Set<String> attrNames) throws SAML2Exception, DataStoreProviderException, SessionException Get binary attributes from a session.- Parameters:
- session- the session
- attrNames- the attr names
- Returns:
- the binary attributes
- Throws:
- SAML2Exception- on failing to get the datastore provider and on failing to read attributes from the datastore provider.
- SessionException- on failing to get the session provider.
- DataStoreProviderException- on failing to read the binary attributes from the datastore provider.
 
 - 
isStaticAttributepublic boolean isStaticAttribute(String attributeName) For the given attributeName, return true if it is flagged as an attribute.- Parameters:
- attributeName- The attributeName to check for the flag
- Returns:
- true if the attributeName is flagged as an attribute
 
 - 
removeStaticAttributeFlagpublic String removeStaticAttributeFlag(String attributeName) Return the attributeName without the flag if it is included.- Parameters:
- attributeName- The attribute name with the flag included
- Returns:
- The attributeName with the flag removed
 
 - 
isBinaryAttributepublic boolean isBinaryAttribute(String attributeName) For the given attributeName, return true if it is flagged as a binary attribute.- Parameters:
- attributeName- The attributeName to check for the binary flag
- Returns:
- true if the attributeName is flagged as a binary attribute
 
 - 
removeBinaryAttributeFlagpublic String removeBinaryAttributeFlag(String attributeName) Return the attributeName without the binary flag if it is included.- Parameters:
- attributeName- The attribute name with the binary flag included
- Returns:
- The attributeName with the binary flag removed
 
 - 
createSAMLAttributepublic Attribute createSAMLAttribute(String name, String nameFormat, Set<String> values) throws SAML2Exception Create a SAMLAttributeobject.- Parameters:
- name- attribute name
- nameFormat- Name format of the attribute
- values- attribute values
- Returns:
- SAML Attribute element
- Throws:
- SAML2Exception
 
 - 
getBinaryAttributeValuespublic Set<String> getBinaryAttributeValues(String samlAttribute, String localAttribute, Map<String,byte[][]> binaryValueMap) Return a Set of Base64 encoded String values that represent the binary attribute values.- Parameters:
- samlAttribute- the SAML attribute that will be assigned these values
- localAttribute- the attribute to find in the map
- binaryValueMap- the map of binary values for the all binary attributes
- Returns:
- Set of Base64 encoded String values for the given binary attribute values
 
 
- 
 
-