Search in sources :

Example 11 with MessageContext

use of org.opensaml.messaging.context.MessageContext in project cas by apereo.

the class ECPProfileHandlerController method handleEcpRequest.

/**
     * Handle ecp request.
     *
     * @param response the response
     * @param request  the request
     * @throws Exception the exception
     */
@PostMapping(path = SamlIdPConstants.ENDPOINT_SAML2_IDP_ECP_PROFILE_SSO, consumes = { MediaType.TEXT_XML_VALUE, "application/vnd.paos.xml" })
public void handleEcpRequest(final HttpServletResponse response, final HttpServletRequest request) throws Exception {
    final MessageContext soapContext = decodeSoapRequest(request);
    final Credential credential = extractBasicAuthenticationCredential(request, response);
    if (credential == null) {
        LOGGER.error("Credentials could not be extracted from the SAML ECP request");
        return;
    }
    if (soapContext == null) {
        LOGGER.error("SAML ECP request could not be determined from the authentication request");
        return;
    }
    handleEcpRequest(response, request, soapContext, credential);
}
Also used : UsernamePasswordCredential(org.apereo.cas.authentication.UsernamePasswordCredential) Credential(org.apereo.cas.authentication.Credential) MessageContext(org.opensaml.messaging.context.MessageContext) PostMapping(org.springframework.web.bind.annotation.PostMapping)

Aggregations

MessageContext (org.opensaml.messaging.context.MessageContext)11 SamlException (org.apereo.cas.support.saml.SamlException)5 SAMLException (org.opensaml.saml.common.SAMLException)4 AuthnRequest (org.opensaml.saml.saml2.core.AuthnRequest)4 UnauthorizedServiceException (org.apereo.cas.services.UnauthorizedServiceException)3 SamlRegisteredService (org.apereo.cas.support.saml.services.SamlRegisteredService)2 SamlRegisteredServiceServiceProviderMetadataFacade (org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade)2 SignableSAMLObject (org.opensaml.saml.common.SignableSAMLObject)2 SOAP11Context (org.opensaml.soap.messaging.context.SOAP11Context)2 GetMapping (org.springframework.web.bind.annotation.GetMapping)2 StringWriter (java.io.StringWriter)1 URLBuilder (net.shibboleth.utilities.java.support.net.URLBuilder)1 Authentication (org.apereo.cas.authentication.Authentication)1 AuthenticationException (org.apereo.cas.authentication.AuthenticationException)1 Credential (org.apereo.cas.authentication.Credential)1 UsernamePasswordCredential (org.apereo.cas.authentication.UsernamePasswordCredential)1 SamlRegisteredServiceCachingMetadataResolver (org.apereo.cas.support.saml.services.idp.metadata.cache.SamlRegisteredServiceCachingMetadataResolver)1 Assertion (org.jasig.cas.client.validation.Assertion)1 DateTime (org.joda.time.DateTime)1 MessageDecodingException (org.opensaml.messaging.decoder.MessageDecodingException)1