Class PersistentNameIDGenerator

java.lang.Object
se.swedenconnect.spring.saml.idp.attributes.nameid.AbstractNameIDGenerator
se.swedenconnect.spring.saml.idp.attributes.nameid.PersistentNameIDGenerator
All Implemented Interfaces:
Serializable, NameIDGenerator

public class PersistentNameIDGenerator extends AbstractNameIDGenerator
A NameIDGenerator for generaring persistent NameIDs.
Author:
Martin Lindström
See Also:
  • Constructor Details

    • PersistentNameIDGenerator

      public PersistentNameIDGenerator(String nameQualifier)
      Constructor.
      Parameters:
      nameQualifier - the name qualifier, usually the IdP entityID
    • PersistentNameIDGenerator

      public PersistentNameIDGenerator(String nameQualifier, String spNameQualifier)
      Constructor.
      Parameters:
      nameQualifier - the name qualifier, usually the IdP entityID
      spNameQualifier - the SP name qualifier
  • Method Details

    • getIdentifier

      protected String getIdentifier(Saml2UserAuthentication authentication)
      Gets the NameID identifier to use.
      Specified by:
      getIdentifier in class AbstractNameIDGenerator
      Parameters:
      authentication - the user authentication object
      Returns:
      an identifier string (never null)
    • getFormat

      protected String getFormat()
      Returns urn:oasis:names:tc:SAML:2.0:nameid-format:persistent.
      Specified by:
      getFormat in class AbstractNameIDGenerator
      Returns:
      the format URI
    • setHashAlgorithm

      public void setHashAlgorithm(String hashAlgorithm)
      Assigns the JCE name for the hash algorithm to use. The default is SHA-256.
      Parameters:
      hashAlgorithm - the JCE name for the hash algorithm