Class BaseSamlProfileSamlResponseBuilder<T extends org.opensaml.core.xml.XMLObject>
- 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.response.BaseSamlProfileSamlResponseBuilder<T>
-
- All Implemented Interfaces:
java.io.Serializable,SamlProfileObjectBuilder
- Direct Known Subclasses:
SamlProfileSaml2ResponseBuilder,SamlProfileSamlSoap11ResponseBuilder
public abstract class BaseSamlProfileSamlResponseBuilder<T extends org.opensaml.core.xml.XMLObject> extends org.apereo.cas.support.saml.util.AbstractSaml20ObjectBuilder implements SamlProfileObjectBuilder
TheBaseSamlProfileSamlResponseBuilderis responsible for building the final SAML assertion for the relying party.- Since:
- 4.2
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BaseSamlProfileSamlResponseBuilder(SamlProfileSamlResponseBuilderConfigurationContext samlResponseBuilderConfigurationContext)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tbuild(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 TbuildResponse(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.AssertionbuildSamlAssertion(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.IssuerbuildSamlResponseIssuer(java.lang.String entityId)Build entity issuer issuer.protected abstract Tencode(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 TencodeFinalResponse(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.SAMLObjectencryptAssertion(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
-
-
-
-
Constructor Detail
-
BaseSamlProfileSamlResponseBuilder
public BaseSamlProfileSamlResponseBuilder(SamlProfileSamlResponseBuilderConfigurationContext samlResponseBuilderConfigurationContext)
-
-
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:SamlProfileObjectBuilderBuild response.- Specified by:
buildin interfaceSamlProfileObjectBuilder<T extends org.opensaml.core.xml.XMLObject>- Parameters:
authnRequest- the authn requestrequest- the requestresponse- the responsecasAssertion- the assertionservice- the serviceadaptor- the adaptorbinding- the bindingmessageContext- 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 requestresponse- the responseservice- the serviceadaptor- the adaptorfinalResponse- the final responsebinding- the bindingauthnRequest- the authn requestassertion- the assertionmessageContext- 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 requestrequest- the requestresponse- the responsecasAssertion- the cas assertionservice- the serviceadaptor- the adaptorbinding- the bindingmessageContext- 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 assertioncasAssertion- the cas assertionauthnRequest- the authn requestservice- the serviceadaptor- the adaptorrequest- the requestresponse- the responsebinding- the bindingmessageContext- 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 servicesamlResponse- the saml responsehttpResponse- the http response; may be null to mute encoding.httpRequest- the http requestadaptor- the adaptorrelayState- the relay statebinding- the bindingauthnRequest- the authn requestassertion- 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.SamlExceptionEncrypt assertion.- Parameters:
assertion- the assertionrequest- the requestresponse- the responseservice- the serviceadaptor- the adaptor- Returns:
- the saml object
- Throws:
org.apereo.cas.support.saml.SamlException- the saml exception
-
-