Class SamlProfileSamlNameIdBuilder

java.lang.Object
org.apereo.cas.support.saml.util.AbstractSamlObjectBuilder
org.apereo.cas.support.saml.util.AbstractSaml20ObjectBuilder
org.apereo.cas.support.saml.web.idp.profile.builders.nameid.SamlProfileSamlNameIdBuilder
All Implemented Interfaces:
Serializable, org.apereo.cas.support.saml.util.Saml20ObjectBuilder, SamlProfileObjectBuilder<org.opensaml.saml.common.SAMLObject>

public class SamlProfileSamlNameIdBuilder extends org.apereo.cas.support.saml.util.AbstractSaml20ObjectBuilder implements SamlProfileObjectBuilder<org.opensaml.saml.common.SAMLObject>
Since:
5.0.0
See Also:
  • Constructor Details

    • SamlProfileSamlNameIdBuilder

      public SamlProfileSamlNameIdBuilder(org.apereo.cas.support.saml.OpenSamlConfigBean configBean, org.apereo.cas.authentication.principal.PersistentIdGenerator persistentIdGenerator, org.opensaml.saml.metadata.resolver.MetadataResolver samlIdPMetadataResolver, SamlIdPObjectEncrypter samlIdPObjectEncrypter)
  • Method Details

    • getSupportedNameIdFormats

      protected static List<String> getSupportedNameIdFormats(SamlProfileBuilderContext context)
    • getRequiredNameIdFormatIfAny

      protected static String getRequiredNameIdFormatIfAny(SamlProfileBuilderContext context)
    • build

      public org.opensaml.saml.common.SAMLObject build(SamlProfileBuilderContext context) throws org.apereo.cas.support.saml.SamlException
      Description copied from interface: SamlProfileObjectBuilder
      Build.
      Specified by:
      build in interface SamlProfileObjectBuilder<org.opensaml.saml.common.SAMLObject>
      Parameters:
      context - the context
      Returns:
      the response
      Throws:
      org.apereo.cas.support.saml.SamlException
    • buildNameId

      protected org.opensaml.saml.saml2.core.NameID buildNameId(SamlProfileBuilderContext context) throws org.apereo.cas.support.saml.SamlException
      Build name id. If there are no explicitly defined NameIDFormats, include the default format. see: here.
      Parameters:
      context - the context
      Returns:
      the name id
      Throws:
      org.apereo.cas.support.saml.SamlException - the saml exception
    • finalizeNameId

      protected org.opensaml.saml.saml2.core.NameID finalizeNameId(org.opensaml.saml.saml2.core.NameID nameid, SamlProfileBuilderContext context)
    • validateRequiredNameIdFormatIfAny

      protected void validateRequiredNameIdFormatIfAny(List<String> supportedNameFormats, String requiredNameFormat, SamlProfileBuilderContext context)
    • determineNameId

      protected org.opensaml.saml.saml2.core.NameID determineNameId(List<String> supportedNameFormats, SamlProfileBuilderContext context)
      Determine name id name id.
      Parameters:
      supportedNameFormats - the supported name formats
      context - the context
      Returns:
      the name id
    • encodeNameIdBasedOnNameFormat

      protected org.opensaml.saml.saml2.core.NameID encodeNameIdBasedOnNameFormat(SamlProfileBuilderContext context, String nameFormat)
    • prepareNameIdAttribute

      protected String prepareNameIdAttribute(SamlProfileBuilderContext context, String nameFormat)
      Prepare name id attribute idp attribute.
      Parameters:
      context - the context
      nameFormat - the name format
      Returns:
      the idp attribute