public abstract class AbstractServiceValidateController extends AbstractDelegateController
Obtain the Service Ticket and Service information and present them to the CAS validation services. Receive back an Assertion containing the user Principal and (possibly) a chain of Proxy Principals. Store the Assertion in the Model and chain to a View to generate the appropriate response (CAS 1, CAS 2 XML, SAML, ...).
applicationContext
Constructor and Description |
---|
AbstractServiceValidateController() |
Modifier and Type | Method and Description |
---|---|
void |
addValidationSpecification(CasProtocolValidationSpecification validationSpecification)
Add validation specification.
|
protected java.util.Map<java.lang.String,?> |
augmentSuccessViewModelObjects(Assertion assertion)
Augment success view model objects.
|
boolean |
canHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Determine if a AbstractDelegateController subclass can handle the current request.
|
protected void |
enforceTicketValidationAuthorizationFor(javax.servlet.http.HttpServletRequest request,
Service service,
Assertion assertion)
Enforce ticket validation authorization for.
|
org.springframework.web.servlet.View |
getFailureView() |
protected Credential |
getServiceCredentialsFromRequest(WebApplicationService service,
javax.servlet.http.HttpServletRequest request)
Overrideable method to determine which credentials to use to grant a
proxy granting ticket.
|
org.springframework.web.servlet.View |
getSuccessView() |
org.springframework.web.servlet.ModelAndView |
handleRequestInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle request internal.
|
protected org.springframework.web.servlet.ModelAndView |
handleTicketValidation(javax.servlet.http.HttpServletRequest request,
WebApplicationService service,
java.lang.String serviceTicketId)
Handle ticket validation model and view.
|
protected void |
initBinder(javax.servlet.http.HttpServletRequest request,
org.springframework.web.bind.ServletRequestDataBinder binder)
Initialize the binder with the required fields.
|
protected void |
onSuccessfulValidation(java.lang.String serviceTicketId,
Assertion assertion)
Triggered on successful validation events.
|
protected void |
prepareForTicketValidation(javax.servlet.http.HttpServletRequest request,
WebApplicationService service,
java.lang.String serviceTicketId)
Prepare for ticket validation.
|
protected org.apache.commons.lang3.tuple.Pair<java.lang.Boolean,java.util.Optional<MultifactorAuthenticationProvider>> |
validateAuthenticationContext(Assertion assertion,
javax.servlet.http.HttpServletRequest request)
Validate authentication context pair.
|
protected Assertion |
validateServiceTicket(WebApplicationService service,
java.lang.String serviceTicketId)
Validate service ticket assertion.
|
protected Credential getServiceCredentialsFromRequest(WebApplicationService service, javax.servlet.http.HttpServletRequest request)
service
- the webapp service requesting proxyrequest
- the HttpServletRequest object.protected org.apache.commons.lang3.tuple.Pair<java.lang.Boolean,java.util.Optional<MultifactorAuthenticationProvider>> validateAuthenticationContext(Assertion assertion, javax.servlet.http.HttpServletRequest request)
assertion
- the assertionrequest
- the requestprotected void initBinder(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.ServletRequestDataBinder binder)
request
- the requestbinder
- the binderpublic org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
AbstractDelegateController
handleRequestInternal
in class AbstractDelegateController
request
- the requestresponse
- the responsejava.lang.Exception
- the exceptionprotected void prepareForTicketValidation(javax.servlet.http.HttpServletRequest request, WebApplicationService service, java.lang.String serviceTicketId)
request
- the requestservice
- the serviceserviceTicketId
- the service ticket idprotected org.springframework.web.servlet.ModelAndView handleTicketValidation(javax.servlet.http.HttpServletRequest request, WebApplicationService service, java.lang.String serviceTicketId)
request
- the requestservice
- the serviceserviceTicketId
- the service ticket idprotected Assertion validateServiceTicket(WebApplicationService service, java.lang.String serviceTicketId)
service
- the serviceserviceTicketId
- the service ticket idprotected void onSuccessfulValidation(java.lang.String serviceTicketId, Assertion assertion)
serviceTicketId
- the service ticket idassertion
- the assertionprotected void enforceTicketValidationAuthorizationFor(javax.servlet.http.HttpServletRequest request, Service service, Assertion assertion)
request
- the requestservice
- the serviceassertion
- the assertionprotected java.util.Map<java.lang.String,?> augmentSuccessViewModelObjects(Assertion assertion)
assertion
- the assertionpublic boolean canHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
AbstractDelegateController
canHandle
in class AbstractDelegateController
request
- the current requestresponse
- the responsepublic org.springframework.web.servlet.View getSuccessView()
public org.springframework.web.servlet.View getFailureView()
public void addValidationSpecification(CasProtocolValidationSpecification validationSpecification)
validationSpecification
- the validation specification