Class AbstractNameIDGenerator

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

public abstract class AbstractNameIDGenerator extends Object implements NameIDGenerator
Abstract base class for the NameIDGenerator interface.
Author:
Martin Lindström
See Also:
  • Constructor Details

    • AbstractNameIDGenerator

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

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

    • getNameID

      public org.opensaml.saml.saml2.core.NameID getNameID(Saml2UserAuthentication authentication)
      Generate a NameID based on the supplied authentication object.
      Specified by:
      getNameID in interface NameIDGenerator
      Parameters:
      authentication - the authentication object
      Returns:
      a NameID
    • getIdentifier

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

      protected abstract String getFormat()
      Gets the Format for this NameID.
      Returns:
      the format URI
    • getNameQualifier

      protected String getNameQualifier()
      Gets the name qualifier, usually the IdP entityID.
      Returns:
      the name qualifier
    • getSpNameQualifier

      protected String getSpNameQualifier()
      Gets SP name qualifier.
      Returns:
      the SP name qualifier