@Controller
public abstract class AbstractSamlProfileHandlerController
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected org.apereo.cas.authentication.AuthenticationSystemSupport |
authenticationSystemSupport
Authentication support to handle credentials and authn subsystem calls.
|
protected org.apereo.cas.authentication.principal.Service |
callbackService
Callback service.
|
protected org.apereo.cas.configuration.CasConfigurationProperties |
casProperties
The cas properties.
|
protected org.apereo.cas.support.saml.OpenSamlConfigBean |
configBean
The Config bean.
|
protected net.shibboleth.utilities.java.support.xml.ParserPool |
parserPool
The Parser pool.
|
protected SamlProfileObjectBuilder<? extends org.opensaml.saml.common.SAMLObject> |
responseBuilder
The Response builder.
|
protected SamlObjectSignatureValidator |
samlObjectSignatureValidator
Signature validator.
|
protected BaseSamlObjectSigner |
samlObjectSigner
The Saml object signer.
|
protected org.apereo.cas.support.saml.services.idp.metadata.cache.SamlRegisteredServiceCachingMetadataResolver |
samlRegisteredServiceCachingMetadataResolver
The Saml registered service caching metadata resolver.
|
protected org.apereo.cas.services.ServicesManager |
servicesManager
The Services manager.
|
protected org.apereo.cas.authentication.principal.ServiceFactory<org.apereo.cas.authentication.principal.WebApplicationService> |
webApplicationServiceFactory
The Web application service factory.
|
| Constructor and Description |
|---|
AbstractSamlProfileHandlerController(BaseSamlObjectSigner samlObjectSigner,
net.shibboleth.utilities.java.support.xml.ParserPool parserPool,
org.apereo.cas.authentication.AuthenticationSystemSupport authenticationSystemSupport,
org.apereo.cas.services.ServicesManager servicesManager,
org.apereo.cas.authentication.principal.ServiceFactory<org.apereo.cas.authentication.principal.WebApplicationService> webApplicationServiceFactory,
org.apereo.cas.support.saml.services.idp.metadata.cache.SamlRegisteredServiceCachingMetadataResolver samlRegisteredServiceCachingMetadataResolver,
org.apereo.cas.support.saml.OpenSamlConfigBean configBean,
SamlProfileObjectBuilder<? extends org.opensaml.saml.common.SAMLObject> responseBuilder,
org.apereo.cas.configuration.CasConfigurationProperties casProperties,
SamlObjectSignatureValidator samlObjectSignatureValidator)
Instantiates a new Abstract saml profile handler controller.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.jasig.cas.client.validation.Assertion |
buildCasAssertion(org.apereo.cas.authentication.Authentication authentication,
org.apereo.cas.authentication.principal.Service service,
org.apereo.cas.services.RegisteredService registeredService,
java.util.Map<java.lang.String,java.lang.Object> attributesToCombine)
Build cas assertion.
|
protected org.jasig.cas.client.validation.Assertion |
buildCasAssertion(java.lang.String principal,
org.apereo.cas.services.RegisteredService registeredService,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Build cas assertion.
|
protected java.lang.String |
buildRedirectUrlByRequestedAuthnContext(java.lang.String initialUrl,
org.opensaml.saml.saml2.core.AuthnRequest authnRequest,
javax.servlet.http.HttpServletRequest request)
Build redirect url by requested authn context.
|
protected void |
buildSamlResponse(javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request,
org.apache.commons.lang3.tuple.Pair<org.opensaml.saml.saml2.core.AuthnRequest,org.opensaml.messaging.context.MessageContext> authenticationContext,
org.jasig.cas.client.validation.Assertion casAssertion,
java.lang.String binding)
Build saml response.
|
protected java.lang.String |
constructServiceUrl(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.apache.commons.lang3.tuple.Pair<? extends org.opensaml.saml.common.SignableSAMLObject,org.opensaml.messaging.context.MessageContext> pair)
Construct service url string.
|
protected org.apache.commons.lang3.tuple.Pair<? extends org.opensaml.saml.common.SignableSAMLObject,org.opensaml.messaging.context.MessageContext> |
decodeSamlContextFromHttpRequest(javax.servlet.http.HttpServletRequest request,
org.opensaml.messaging.decoder.servlet.BaseHttpServletRequestXMLMessageDecoder decoder,
java.lang.Class<? extends org.opensaml.saml.common.SignableSAMLObject> clazz)
Decode authentication request saml object.
|
protected org.opensaml.messaging.context.MessageContext |
decodeSoapRequest(javax.servlet.http.HttpServletRequest request)
Decode soap 11 context.
|
protected java.util.Map<java.lang.String,java.lang.String> |
getAuthenticationContextMappings()
Gets authentication context mappings.
|
protected org.apache.commons.lang3.tuple.Pair<org.apereo.cas.support.saml.services.SamlRegisteredService,org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade> |
getRegisteredServiceAndFacade(org.opensaml.saml.saml2.core.AuthnRequest request)
Gets registered service and facade.
|
protected java.util.Optional<org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade> |
getSamlMetadataFacadeFor(org.apereo.cas.support.saml.services.SamlRegisteredService registeredService,
org.opensaml.saml.saml2.core.RequestAbstractType authnRequest)
Gets saml metadata adaptor for service.
|
protected java.util.Optional<org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade> |
getSamlMetadataFacadeFor(org.apereo.cas.support.saml.services.SamlRegisteredService registeredService,
java.lang.String entityId)
Gets saml metadata adaptor for service.
|
org.springframework.web.servlet.ModelAndView |
handleUnauthorizedServiceException(javax.servlet.http.HttpServletRequest req,
java.lang.Exception ex)
Handle unauthorized service exception.
|
protected void |
initialize()
Post constructor placeholder for additional
extensions.
|
protected void |
initiateAuthenticationRequest(org.apache.commons.lang3.tuple.Pair<? extends org.opensaml.saml.common.SignableSAMLObject,org.opensaml.messaging.context.MessageContext> pair,
javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request)
Initiate authentication request.
|
protected void |
issueAuthenticationRequestRedirect(org.apache.commons.lang3.tuple.Pair<? extends org.opensaml.saml.common.SignableSAMLObject,org.opensaml.messaging.context.MessageContext> pair,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Redirect request for authentication.
|
protected void |
logCasValidationAssertion(org.jasig.cas.client.validation.Assertion assertion)
Log cas validation assertion.
|
protected org.apereo.cas.authentication.principal.Service |
registerCallback(java.lang.String callbackUrl)
Initialize callback service.
|
protected org.opensaml.saml.saml2.core.AuthnRequest |
retrieveSamlAuthenticationRequestFromHttpRequest(javax.servlet.http.HttpServletRequest request)
Retrieve authn request authn request.
|
protected void |
verifyAuthenticationContextSignature(org.opensaml.messaging.context.MessageContext ctx,
javax.servlet.http.HttpServletRequest request,
org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
Verify authentication context signature.
|
protected void |
verifyAuthenticationContextSignature(org.apache.commons.lang3.tuple.Pair<? extends org.opensaml.saml.common.SignableSAMLObject,org.opensaml.messaging.context.MessageContext> authenticationContext,
javax.servlet.http.HttpServletRequest request,
org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
Verify authentication context signature.
|
protected org.apache.commons.lang3.tuple.Pair<org.apereo.cas.support.saml.services.SamlRegisteredService,org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade> |
verifySamlAuthenticationRequest(org.apache.commons.lang3.tuple.Pair<? extends org.opensaml.saml.common.SignableSAMLObject,org.opensaml.messaging.context.MessageContext> authenticationContext,
javax.servlet.http.HttpServletRequest request)
Verify saml authentication request.
|
protected org.apereo.cas.support.saml.services.SamlRegisteredService |
verifySamlRegisteredService(java.lang.String serviceId)
Gets registered service and verify.
|
protected org.apereo.cas.authentication.AuthenticationSystemSupport authenticationSystemSupport
protected BaseSamlObjectSigner samlObjectSigner
protected SamlObjectSignatureValidator samlObjectSignatureValidator
protected net.shibboleth.utilities.java.support.xml.ParserPool parserPool
protected org.apereo.cas.authentication.principal.Service callbackService
protected org.apereo.cas.services.ServicesManager servicesManager
protected org.apereo.cas.authentication.principal.ServiceFactory<org.apereo.cas.authentication.principal.WebApplicationService> webApplicationServiceFactory
protected org.apereo.cas.support.saml.services.idp.metadata.cache.SamlRegisteredServiceCachingMetadataResolver samlRegisteredServiceCachingMetadataResolver
protected org.apereo.cas.support.saml.OpenSamlConfigBean configBean
protected SamlProfileObjectBuilder<? extends org.opensaml.saml.common.SAMLObject> responseBuilder
protected org.apereo.cas.configuration.CasConfigurationProperties casProperties
public AbstractSamlProfileHandlerController(BaseSamlObjectSigner samlObjectSigner, net.shibboleth.utilities.java.support.xml.ParserPool parserPool, org.apereo.cas.authentication.AuthenticationSystemSupport authenticationSystemSupport, org.apereo.cas.services.ServicesManager servicesManager, org.apereo.cas.authentication.principal.ServiceFactory<org.apereo.cas.authentication.principal.WebApplicationService> webApplicationServiceFactory, org.apereo.cas.support.saml.services.idp.metadata.cache.SamlRegisteredServiceCachingMetadataResolver samlRegisteredServiceCachingMetadataResolver, org.apereo.cas.support.saml.OpenSamlConfigBean configBean, SamlProfileObjectBuilder<? extends org.opensaml.saml.common.SAMLObject> responseBuilder, org.apereo.cas.configuration.CasConfigurationProperties casProperties, SamlObjectSignatureValidator samlObjectSignatureValidator)
samlObjectSigner - the saml object signerparserPool - the parser poolauthenticationSystemSupport - the authentication system supportservicesManager - the services managerwebApplicationServiceFactory - the web application service factorysamlRegisteredServiceCachingMetadataResolver - the saml registered service caching metadata resolverconfigBean - the config beanresponseBuilder - the response buildercasProperties - the cas propertiessamlObjectSignatureValidator - the saml object signature validator@PostConstruct protected void initialize()
protected java.util.Optional<org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade> getSamlMetadataFacadeFor(org.apereo.cas.support.saml.services.SamlRegisteredService registeredService,
org.opensaml.saml.saml2.core.RequestAbstractType authnRequest)
registeredService - the registered serviceauthnRequest - the authn requestprotected java.util.Optional<org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade> getSamlMetadataFacadeFor(org.apereo.cas.support.saml.services.SamlRegisteredService registeredService,
java.lang.String entityId)
registeredService - the registered serviceentityId - the entity idprotected org.apereo.cas.support.saml.services.SamlRegisteredService verifySamlRegisteredService(java.lang.String serviceId)
serviceId - the service idprotected org.apereo.cas.authentication.principal.Service registerCallback(java.lang.String callbackUrl)
callbackUrl - the callback urlprotected org.opensaml.saml.saml2.core.AuthnRequest retrieveSamlAuthenticationRequestFromHttpRequest(javax.servlet.http.HttpServletRequest request)
throws java.lang.Exception
request - the requestjava.lang.Exception - the exceptionprotected org.jasig.cas.client.validation.Assertion buildCasAssertion(org.apereo.cas.authentication.Authentication authentication,
org.apereo.cas.authentication.principal.Service service,
org.apereo.cas.services.RegisteredService registeredService,
java.util.Map<java.lang.String,java.lang.Object> attributesToCombine)
authentication - the authenticationservice - the serviceregisteredService - the registered serviceattributesToCombine - the attributes to combineprotected org.jasig.cas.client.validation.Assertion buildCasAssertion(java.lang.String principal,
org.apereo.cas.services.RegisteredService registeredService,
java.util.Map<java.lang.String,java.lang.Object> attributes)
principal - the principalregisteredService - the registered serviceattributes - the attributesprotected org.apache.commons.lang3.tuple.Pair<? extends org.opensaml.saml.common.SignableSAMLObject,org.opensaml.messaging.context.MessageContext> decodeSamlContextFromHttpRequest(javax.servlet.http.HttpServletRequest request,
org.opensaml.messaging.decoder.servlet.BaseHttpServletRequestXMLMessageDecoder decoder,
java.lang.Class<? extends org.opensaml.saml.common.SignableSAMLObject> clazz)
request - the requestdecoder - the decoderclazz - the clazzprotected void logCasValidationAssertion(org.jasig.cas.client.validation.Assertion assertion)
assertion - the assertionprotected void issueAuthenticationRequestRedirect(org.apache.commons.lang3.tuple.Pair<? extends org.opensaml.saml.common.SignableSAMLObject,org.opensaml.messaging.context.MessageContext> pair,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.lang.Exception
pair - the pairrequest - the requestresponse - the responsejava.lang.Exception - the exceptionprotected java.util.Map<java.lang.String,java.lang.String> getAuthenticationContextMappings()
protected java.lang.String buildRedirectUrlByRequestedAuthnContext(java.lang.String initialUrl,
org.opensaml.saml.saml2.core.AuthnRequest authnRequest,
javax.servlet.http.HttpServletRequest request)
initialUrl - the initial urlauthnRequest - the authn requestrequest - the requestprotected java.lang.String constructServiceUrl(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.apache.commons.lang3.tuple.Pair<? extends org.opensaml.saml.common.SignableSAMLObject,org.opensaml.messaging.context.MessageContext> pair)
throws org.apereo.cas.support.saml.SamlException
request - the requestresponse - the responsepair - the pairorg.apereo.cas.support.saml.SamlException - the saml exceptionprotected void initiateAuthenticationRequest(org.apache.commons.lang3.tuple.Pair<? extends org.opensaml.saml.common.SignableSAMLObject,org.opensaml.messaging.context.MessageContext> pair,
javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request)
throws java.lang.Exception
pair - the pairresponse - the responserequest - the requestjava.lang.Exception - the exceptionprotected org.apache.commons.lang3.tuple.Pair<org.apereo.cas.support.saml.services.SamlRegisteredService,org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade> verifySamlAuthenticationRequest(org.apache.commons.lang3.tuple.Pair<? extends org.opensaml.saml.common.SignableSAMLObject,org.opensaml.messaging.context.MessageContext> authenticationContext,
javax.servlet.http.HttpServletRequest request)
throws java.lang.Exception
authenticationContext - the pairrequest - the requestjava.lang.Exception - the exceptionprotected void verifyAuthenticationContextSignature(org.apache.commons.lang3.tuple.Pair<? extends org.opensaml.saml.common.SignableSAMLObject,org.opensaml.messaging.context.MessageContext> authenticationContext,
javax.servlet.http.HttpServletRequest request,
org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
throws java.lang.Exception
authenticationContext - the authentication contextrequest - the requestauthnRequest - the authn requestadaptor - the adaptorjava.lang.Exception - the exceptionprotected void verifyAuthenticationContextSignature(org.opensaml.messaging.context.MessageContext ctx,
javax.servlet.http.HttpServletRequest request,
org.opensaml.saml.saml2.core.RequestAbstractType authnRequest,
org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade adaptor)
throws java.lang.Exception
ctx - the authentication contextrequest - the requestauthnRequest - the authn requestadaptor - the adaptorjava.lang.Exception - the exceptionprotected void buildSamlResponse(javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request,
org.apache.commons.lang3.tuple.Pair<org.opensaml.saml.saml2.core.AuthnRequest,org.opensaml.messaging.context.MessageContext> authenticationContext,
org.jasig.cas.client.validation.Assertion casAssertion,
java.lang.String binding)
response - the responserequest - the requestauthenticationContext - the authentication contextcasAssertion - the cas assertionbinding - the bindingprotected org.apache.commons.lang3.tuple.Pair<org.apereo.cas.support.saml.services.SamlRegisteredService,org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade> getRegisteredServiceAndFacade(org.opensaml.saml.saml2.core.AuthnRequest request)
request - the requestprotected org.opensaml.messaging.context.MessageContext decodeSoapRequest(javax.servlet.http.HttpServletRequest request)
request - the request@ExceptionHandler(value=org.apereo.cas.services.UnauthorizedServiceException.class)
public org.springframework.web.servlet.ModelAndView handleUnauthorizedServiceException(javax.servlet.http.HttpServletRequest req,
java.lang.Exception ex)
req - the reqex - the ex