Class SamlProfileSamlNameIdBuilder

    • Field Summary

      • Fields inherited from class org.apereo.cas.support.saml.util.AbstractSamlObjectBuilder

        DEFAULT_ELEMENT_LOCAL_NAME_FIELD, DEFAULT_ELEMENT_NAME_FIELD, openSamlConfigBean
    • Constructor Summary

      Constructors 
      Constructor Description
      SamlProfileSamlNameIdBuilder​(org.apereo.cas.support.saml.OpenSamlConfigBean configBean, org.apereo.cas.authentication.principal.PersistentIdGenerator persistentIdGenerator, SamlIdPObjectEncrypter samlObjectEncrypter)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.opensaml.saml.saml2.core.NameID build​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object assertion, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor, java.lang.String binding, org.opensaml.messaging.context.MessageContext messageContext)
      Build response.
      protected org.opensaml.saml.saml2.core.NameID determineNameId​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.Object assertion, java.util.List<java.lang.String> supportedNameFormats, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
      Determine name id name id.
      protected org.opensaml.saml.saml2.core.NameID encodeNameIdBasedOnNameFormat​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.Object assertion, java.lang.String nameFormat, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
      Encode name id based on name format name id.
      protected org.opensaml.saml.saml2.core.NameID finalizeNameId​(org.opensaml.saml.saml2.core.NameID nameid, org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.Object assertion, java.util.List<java.lang.String> supportedNameFormats, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
      Finalize name id name id.
      protected static java.lang.String getRequiredNameIdFormatIfAny​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest)
      Gets required name id format if any.
      protected static java.util.List<java.lang.String> getSupportedNameIdFormats​(org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
      Gets supported name id formats.
      protected net.shibboleth.idp.attribute.IdPAttribute prepareNameIdAttribute​(java.lang.Object casAssertion, java.lang.String nameFormat, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor, org.apereo.cas.support.saml.services.SamlRegisteredService registeredService)
      Prepare name id attribute id p attribute.
      protected static net.shibboleth.idp.saml.attribute.encoding.impl.SAML2StringNameIDEncoder prepareNameIdEncoder​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.String nameFormat, net.shibboleth.idp.attribute.IdPAttribute attribute, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
      Prepare name id encoder saml 2 string name id encoder.
      protected void validateRequiredNameIdFormatIfAny​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor, java.util.List<java.lang.String> supportedNameFormats, java.lang.String requiredNameFormat)
      Validate required name id format if any.
      • Methods inherited from class org.apereo.cas.support.saml.util.AbstractSaml20ObjectBuilder

        addAttributeValuesToSaml2Attribute, decodeSamlAuthnRequest, generateSecureRandomId, getNameID, inflateAuthnRequest, newAssertion, newAssertion, newAttribute, newAttributeStatement, newAttributeStatement, newAuthnStatement, newConditions, newEcpResponse, newIssuer, newLogoutRequest, newResponse, newStatus, newSubject, newSubject
      • Methods inherited from class org.apereo.cas.support.saml.util.AbstractSamlObjectBuilder

        addAttributeValuesToSamlAttribute, constructDocumentFromXml, getOpenSamlConfigBean, getSamlObjectQName, newAttributeValue, newSamlObject, newSoapObject, signSamlResponse
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SamlProfileSamlNameIdBuilder

        public SamlProfileSamlNameIdBuilder​(org.apereo.cas.support.saml.OpenSamlConfigBean configBean,
                                            org.apereo.cas.authentication.principal.PersistentIdGenerator persistentIdGenerator,
                                            SamlIdPObjectEncrypter samlObjectEncrypter)
    • Method Detail

      • getSupportedNameIdFormats

        protected static java.util.List<java.lang.String> getSupportedNameIdFormats​(org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                                                                    org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
        Gets supported name id formats.
        Parameters:
        service - the service
        adaptor - the adaptor
        Returns:
        the supported name id formats
      • build

        public org.opensaml.saml.saml2.core.NameID build​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
                                                         javax.servlet.http.HttpServletRequest request,
                                                         javax.servlet.http.HttpServletResponse response,
                                                         java.lang.Object assertion,
                                                         org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                                         org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
                                                         java.lang.String binding,
                                                         org.opensaml.messaging.context.MessageContext messageContext)
                                                  throws org.apereo.cas.support.saml.SamlException
        Description copied from interface: SamlProfileObjectBuilder
        Build response.
        Specified by:
        build in interface SamlProfileObjectBuilder<org.opensaml.saml.saml2.core.NameID>
        Parameters:
        authnRequest - the authn request
        request - the request
        response - the response
        assertion - the assertion
        service - the service
        adaptor - the adaptor
        binding - the binding
        messageContext - the message context
        Returns:
        the response
        Throws:
        org.apereo.cas.support.saml.SamlException - the exception
      • finalizeNameId

        protected org.opensaml.saml.saml2.core.NameID finalizeNameId​(org.opensaml.saml.saml2.core.NameID nameid,
                                                                     org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
                                                                     java.lang.Object assertion,
                                                                     java.util.List<java.lang.String> supportedNameFormats,
                                                                     org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                                                     org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
        Finalize name id name id.
        Parameters:
        nameid - the nameid
        authnRequest - the authn request
        assertion - the assertion
        supportedNameFormats - the supported name formats
        service - the service
        adaptor - the adaptor
        Returns:
        the name id
      • validateRequiredNameIdFormatIfAny

        protected void validateRequiredNameIdFormatIfAny​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
                                                         org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
                                                         java.util.List<java.lang.String> supportedNameFormats,
                                                         java.lang.String requiredNameFormat)
        Validate required name id format if any.
        Parameters:
        authnRequest - the authn request
        adaptor - the adaptor
        supportedNameFormats - the supported name formats
        requiredNameFormat - the required name format
      • getRequiredNameIdFormatIfAny

        protected static java.lang.String getRequiredNameIdFormatIfAny​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest)
        Gets required name id format if any.
        Parameters:
        authnRequest - the authn request
        Returns:
        the required name id format if any
      • determineNameId

        protected org.opensaml.saml.saml2.core.NameID determineNameId​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
                                                                      java.lang.Object assertion,
                                                                      java.util.List<java.lang.String> supportedNameFormats,
                                                                      org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                                                      org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
        Determine name id name id.
        Parameters:
        authnRequest - the authn request
        assertion - the assertion
        supportedNameFormats - the supported name formats
        service - the service
        adaptor - the adaptor
        Returns:
        the name id
      • encodeNameIdBasedOnNameFormat

        protected org.opensaml.saml.saml2.core.NameID encodeNameIdBasedOnNameFormat​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
                                                                                    java.lang.Object assertion,
                                                                                    java.lang.String nameFormat,
                                                                                    org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                                                                    org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
        Encode name id based on name format name id.
        Parameters:
        authnRequest - the authn request
        assertion - the assertion
        nameFormat - the name format
        service - the service
        adaptor - the adaptor
        Returns:
        the name id
      • prepareNameIdAttribute

        protected net.shibboleth.idp.attribute.IdPAttribute prepareNameIdAttribute​(java.lang.Object casAssertion,
                                                                                   java.lang.String nameFormat,
                                                                                   org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
                                                                                   org.apereo.cas.support.saml.services.SamlRegisteredService registeredService)
        Prepare name id attribute id p attribute.
        Parameters:
        casAssertion - the assertion
        nameFormat - the name format
        adaptor - the adaptor
        registeredService - the registered service
        Returns:
        the idp attribute
      • prepareNameIdEncoder

        protected static net.shibboleth.idp.saml.attribute.encoding.impl.SAML2StringNameIDEncoder prepareNameIdEncoder​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
                                                                                                                       java.lang.String nameFormat,
                                                                                                                       net.shibboleth.idp.attribute.IdPAttribute attribute,
                                                                                                                       org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                                                                                                       org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
        Prepare name id encoder saml 2 string name id encoder.
        Parameters:
        authnRequest - the authn request
        nameFormat - the name format
        attribute - the attribute
        service - the service
        adaptor - the adaptor
        Returns:
        the saml 2 string name id encoder