Class BaseSamlProfileSamlResponseBuilder<T extends org.opensaml.core.xml.XMLObject>

    • Field Summary

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

        DEFAULT_ELEMENT_LOCAL_NAME_FIELD, DEFAULT_ELEMENT_NAME_FIELD, openSamlConfigBean
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      T build​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object casAssertion, 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 abstract T buildResponse​(org.opensaml.saml.saml2.core.Assertion assertion, java.lang.Object casAssertion, org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String binding, org.opensaml.messaging.context.MessageContext messageContext)
      Build response response.
      protected org.opensaml.saml.saml2.core.Assertion buildSamlAssertion​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object casAssertion, 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 saml assertion assertion.
      protected org.opensaml.saml.saml2.core.Issuer buildSamlResponseIssuer​(java.lang.String entityId)
      Build entity issuer issuer.
      protected abstract T encode​(org.apereo.cas.support.saml.services.SamlRegisteredService service, T samlResponse, javax.servlet.http.HttpServletResponse httpResponse, javax.servlet.http.HttpServletRequest httpRequest, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor, java.lang.String relayState, java.lang.String binding, org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.Object assertion)
      Encode the final result into the http response.
      protected T encodeFinalResponse​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor, T finalResponse, java.lang.String binding, org.opensaml.saml.saml2.core.RequestAbstractType authnRequest, java.lang.Object assertion, org.opensaml.messaging.context.MessageContext messageContext)
      Encode final response.
      protected org.opensaml.saml.common.SAMLObject encryptAssertion​(org.opensaml.saml.saml2.core.Assertion assertion, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apereo.cas.support.saml.services.SamlRegisteredService service, org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
      Encrypt assertion.
      • 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
    • Method Detail

      • build

        public T build​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
                       javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       java.lang.Object casAssertion,
                       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<T extends org.opensaml.core.xml.XMLObject>
        Parameters:
        authnRequest - the authn request
        request - the request
        response - the response
        casAssertion - 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
      • encodeFinalResponse

        protected T encodeFinalResponse​(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response,
                                        org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                        org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
                                        T finalResponse,
                                        java.lang.String binding,
                                        org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
                                        java.lang.Object assertion,
                                        org.opensaml.messaging.context.MessageContext messageContext)
        Encode final response.
        Parameters:
        request - the request
        response - the response
        service - the service
        adaptor - the adaptor
        finalResponse - the final response
        binding - the binding
        authnRequest - the authn request
        assertion - the assertion
        messageContext - the message context
        Returns:
        the response
      • buildSamlAssertion

        protected org.opensaml.saml.saml2.core.Assertion buildSamlAssertion​(org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
                                                                            javax.servlet.http.HttpServletRequest request,
                                                                            javax.servlet.http.HttpServletResponse response,
                                                                            java.lang.Object casAssertion,
                                                                            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 saml assertion assertion.
        Parameters:
        authnRequest - the authn request
        request - the request
        response - the response
        casAssertion - the cas assertion
        service - the service
        adaptor - the adaptor
        binding - the binding
        messageContext - the message context
        Returns:
        the assertion
      • buildResponse

        protected abstract T buildResponse​(org.opensaml.saml.saml2.core.Assertion assertion,
                                           java.lang.Object casAssertion,
                                           org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
                                           org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                           org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
                                           javax.servlet.http.HttpServletRequest request,
                                           javax.servlet.http.HttpServletResponse response,
                                           java.lang.String binding,
                                           org.opensaml.messaging.context.MessageContext messageContext)
                                    throws org.apereo.cas.support.saml.SamlException
        Build response response.
        Parameters:
        assertion - the assertion
        casAssertion - the cas assertion
        authnRequest - the authn request
        service - the service
        adaptor - the adaptor
        request - the request
        response - the response
        binding - the binding
        messageContext - the message context
        Returns:
        the response
        Throws:
        org.apereo.cas.support.saml.SamlException - the saml exception
      • buildSamlResponseIssuer

        protected org.opensaml.saml.saml2.core.Issuer buildSamlResponseIssuer​(java.lang.String entityId)
        Build entity issuer issuer.
        Parameters:
        entityId - the entity id
        Returns:
        the issuer
      • encode

        protected abstract T encode​(org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                    T samlResponse,
                                    javax.servlet.http.HttpServletResponse httpResponse,
                                    javax.servlet.http.HttpServletRequest httpRequest,
                                    org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
                                    java.lang.String relayState,
                                    java.lang.String binding,
                                    org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
                                    java.lang.Object assertion)
                             throws org.apereo.cas.support.saml.SamlException
        Encode the final result into the http response.
        Parameters:
        service - the service
        samlResponse - the saml response
        httpResponse - the http response; may be null to mute encoding.
        httpRequest - the http request
        adaptor - the adaptor
        relayState - the relay state
        binding - the binding
        authnRequest - the authn request
        assertion - the assertion
        Returns:
        the t
        Throws:
        org.apereo.cas.support.saml.SamlException - the saml exception
      • encryptAssertion

        protected org.opensaml.saml.common.SAMLObject encryptAssertion​(org.opensaml.saml.saml2.core.Assertion assertion,
                                                                       javax.servlet.http.HttpServletRequest request,
                                                                       javax.servlet.http.HttpServletResponse response,
                                                                       org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                                                       org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
                                                                throws org.apereo.cas.support.saml.SamlException
        Encrypt assertion.
        Parameters:
        assertion - the assertion
        request - the request
        response - the response
        service - the service
        adaptor - the adaptor
        Returns:
        the saml object
        Throws:
        org.apereo.cas.support.saml.SamlException - the saml exception