Class IdpAttributeMapperScriptHelper


  • @EvolvingAll
    public class IdpAttributeMapperScriptHelper
    extends Object
    This class exposes methods that are only intended to be used by IDP Attribute Mapper script types.
    • Method Detail

      • 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 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.
      • getRemoteSPConfigAttributeMap

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