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 Details

  • Method Details

    • isSessionValid

      public 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
    • getHostedIDPConfigAttributeMap

      public Map<String,String> getHostedIDPConfigAttributeMap(String realm, String hostedEntityId) throws com.sun.identity.saml2.common.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:
      com.sun.identity.saml2.common.SAML2Exception - if any failure.
    • getRemoteSPConfigAttributeMap

      public Map<String,String> getRemoteSPConfigAttributeMap(String realm, String remoteEntityId) throws com.sun.identity.saml2.common.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:
      com.sun.identity.saml2.common.SAML2Exception - if any failure.
    • isIgnoredProfile

      public 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.
    • getPropertySet

      public 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.
    • getAttributes

      public Map<String,Set<String>> getAttributes(Object session, Set<String> attrNames) throws com.sun.identity.saml2.common.SAML2Exception, DataStoreProviderException, SessionException
      Get attributes from a session.
      Parameters:
      session - the session
      attrNames - the attr names
      Returns:
      the attributes from session
      Throws:
      com.sun.identity.saml2.common.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.
    • getBinaryAttributes

      public Map<String,byte[][]> getBinaryAttributes(Object session, Set<String> attrNames) throws com.sun.identity.saml2.common.SAML2Exception, DataStoreProviderException, SessionException
      Get binary attributes from a session.
      Parameters:
      session - the session
      attrNames - the attr names
      Returns:
      the binary attributes
      Throws:
      com.sun.identity.saml2.common.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.
    • isStaticAttribute

      public 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
    • removeStaticAttributeFlag

      public 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
    • isBinaryAttribute

      public 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
    • removeBinaryAttributeFlag

      public 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
    • createSAMLAttribute

      public Attribute createSAMLAttribute(String name, String nameFormat, Set<String> values) throws com.sun.identity.saml2.common.SAML2Exception
      Create a SAML Attribute object.
      Parameters:
      name - attribute name
      nameFormat - Name format of the attribute
      values - attribute values
      Returns:
      SAML Attribute element
      Throws:
      com.sun.identity.saml2.common.SAML2Exception
    • getBinaryAttributeValues

      public 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