Package org.apereo.cas.services.web.view
Class AbstractCasView
- java.lang.Object
-
- org.springframework.context.support.ApplicationObjectSupport
-
- org.springframework.web.context.support.WebApplicationObjectSupport
-
- org.springframework.web.servlet.view.AbstractView
-
- org.apereo.cas.services.web.view.AbstractCasView
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.context.ApplicationContextAware,org.springframework.web.context.ServletContextAware,org.springframework.web.servlet.View
- Direct Known Subclasses:
AbstractDelegatingCasView
public abstract class AbstractCasView extends org.springframework.web.servlet.view.AbstractViewAbstract class to handle retrieving the Assertion from the model.- Since:
- 3.1
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apereo.cas.validation.CasProtocolAttributesRendererattributesRendererCAS attribute renderer.protected org.apereo.cas.validation.AuthenticationAttributeReleasePolicyauthenticationAttributeReleasePolicyAuthentication attribute release policy.protected org.apereo.cas.authentication.AuthenticationServiceSelectionPlanauthenticationRequestServiceSelectionStrategiesThe Service selection strategy.protected org.apereo.cas.authentication.ProtocolAttributeEncoderprotocolAttributeEncoderThe attribute encoder instance.protected org.apereo.cas.services.ServicesManagerservicesManagerThe Services manager.protected booleansuccessResponseIndicate whether this view will be generating the success response or not.
-
Constructor Summary
Constructors Constructor Description AbstractCasView()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apereo.cas.validation.AssertiongetAssertionFrom(java.util.Map<java.lang.String,java.lang.Object> model)Gets the assertion from the model.protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>>getCasPrincipalAttributes(java.util.Map<java.lang.String,java.lang.Object> model, org.apereo.cas.services.RegisteredService registeredService)Put cas principal attributes into model.protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>>getCasProtocolAuthenticationAttributes(java.util.Map<java.lang.String,java.lang.Object> model, org.apereo.cas.services.RegisteredService registeredService)Put cas authentication attributes into model.protected java.util.Collection<org.apereo.cas.authentication.Authentication>getChainedAuthentications(java.util.Map<java.lang.String,java.lang.Object> model)Gets chained authentications.protected java.lang.StringgetErrorCodeFrom(java.util.Map<java.lang.String,java.lang.Object> model)Gets error code from.protected java.lang.StringgetErrorDescriptionFrom(java.util.Map<java.lang.String,java.lang.Object> model)Gets error description from.protected java.util.Map<java.lang.String,java.lang.Object>getModelAttributes(java.util.Map<java.lang.String,java.lang.Object> model)Gets model attributes.protected org.apereo.cas.authentication.AuthenticationgetPrimaryAuthenticationFrom(java.util.Map<java.lang.String,java.lang.Object> model)Gets the authentication from the model.protected org.apereo.cas.authentication.principal.PrincipalgetPrincipal(java.util.Map<java.lang.String,java.lang.Object> model)Gets the principal from the model.protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>>getPrincipalAttributesAsMultiValuedAttributes(java.util.Map<java.lang.String,java.lang.Object> model)Gets principal attributes.protected java.lang.StringgetProxyGrantingTicketIou(java.util.Map<java.lang.String,java.lang.Object> model)Gets the PGT-IOU from the model.protected org.apereo.cas.authentication.principal.WebApplicationServicegetServiceFrom(java.util.Map<java.lang.String,java.lang.Object> model)Gets validated service from the model.protected voidprepareCasResponseAttributesForViewModel(java.util.Map<java.lang.String,java.lang.Object> model)Prepare cas response attributes for view model.protected java.util.MapprepareViewModelWithAuthenticationPrincipal(java.util.Map<java.lang.String,java.lang.Object> model)Prepare view model with authentication principal.protected voidputCasResponseAttributesIntoModel(java.util.Map<java.lang.String,java.lang.Object> model, java.util.Map<java.lang.String,java.lang.Object> attributes, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.validation.CasProtocolAttributesRenderer attributesRenderer)Put cas response attributes into model.protected voidputIntoModel(java.util.Map<java.lang.String,java.lang.Object> model, java.lang.String key, java.lang.Object value)Put into model.-
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, formatViewName, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, prepareResponse, render, renderMergedOutputModel, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, setResponseContentType, toString, writeToResponse
-
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
-
-
-
-
Field Detail
-
successResponse
protected final boolean successResponse
Indicate whether this view will be generating the success response or not. By default, the view is treated as a failure.
-
protocolAttributeEncoder
protected final org.apereo.cas.authentication.ProtocolAttributeEncoder protocolAttributeEncoder
The attribute encoder instance.
-
servicesManager
protected final org.apereo.cas.services.ServicesManager servicesManager
The Services manager.
-
authenticationAttributeReleasePolicy
protected final org.apereo.cas.validation.AuthenticationAttributeReleasePolicy authenticationAttributeReleasePolicy
Authentication attribute release policy.
-
authenticationRequestServiceSelectionStrategies
protected final org.apereo.cas.authentication.AuthenticationServiceSelectionPlan authenticationRequestServiceSelectionStrategies
The Service selection strategy.
-
attributesRenderer
protected final org.apereo.cas.validation.CasProtocolAttributesRenderer attributesRenderer
CAS attribute renderer.
-
-
Method Detail
-
getAssertionFrom
protected org.apereo.cas.validation.Assertion getAssertionFrom(java.util.Map<java.lang.String,java.lang.Object> model)
Gets the assertion from the model.- Parameters:
model- the model- Returns:
- the assertion from
-
getErrorCodeFrom
protected java.lang.String getErrorCodeFrom(java.util.Map<java.lang.String,java.lang.Object> model)
Gets error code from.- Parameters:
model- the model- Returns:
- the error code from
-
getErrorDescriptionFrom
protected java.lang.String getErrorDescriptionFrom(java.util.Map<java.lang.String,java.lang.Object> model)
Gets error description from.- Parameters:
model- the model- Returns:
- the error description from
-
getProxyGrantingTicketIou
protected java.lang.String getProxyGrantingTicketIou(java.util.Map<java.lang.String,java.lang.Object> model)
Gets the PGT-IOU from the model.- Parameters:
model- the model- Returns:
- the pgt-iou id
-
getPrimaryAuthenticationFrom
protected org.apereo.cas.authentication.Authentication getPrimaryAuthenticationFrom(java.util.Map<java.lang.String,java.lang.Object> model)
Gets the authentication from the model.- Parameters:
model- the model- Returns:
- the assertion from
- Since:
- 4.1.0
-
getModelAttributes
protected java.util.Map<java.lang.String,java.lang.Object> getModelAttributes(java.util.Map<java.lang.String,java.lang.Object> model)
Gets model attributes.- Parameters:
model- the model- Returns:
- the model attributes
-
getPrincipal
protected org.apereo.cas.authentication.principal.Principal getPrincipal(java.util.Map<java.lang.String,java.lang.Object> model)
Gets the principal from the model.- Parameters:
model- the model- Returns:
- the assertion from
- Since:
- 4.1.0
-
getPrincipalAttributesAsMultiValuedAttributes
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getPrincipalAttributesAsMultiValuedAttributes(java.util.Map<java.lang.String,java.lang.Object> model)
Gets principal attributes. Single-valued attributes are converted to a collection so the review can easily loop through all.- Parameters:
model- the model- Returns:
- the attributes
- Since:
- 4.1.0
-
getServiceFrom
protected org.apereo.cas.authentication.principal.WebApplicationService getServiceFrom(java.util.Map<java.lang.String,java.lang.Object> model)
Gets validated service from the model.- Parameters:
model- the model- Returns:
- the validated service from
-
getChainedAuthentications
protected java.util.Collection<org.apereo.cas.authentication.Authentication> getChainedAuthentications(java.util.Map<java.lang.String,java.lang.Object> model)
Gets chained authentications. Note that the last index in the list always describes the primary authentication event. All others in the chain should denote proxies. Per the CAS protocol, when authentication has proceeded through multiple proxies, the order in which the proxies were traversed MUST be reflected in the response. The most recently-visited proxy MUST be the first proxy listed, and all the other proxies MUST be shifted down as new proxies are added.- Parameters:
model- the model- Returns:
- the chained authentications
-
putIntoModel
protected void putIntoModel(java.util.Map<java.lang.String,java.lang.Object> model, java.lang.String key, java.lang.Object value)Put into model.- Parameters:
model- the modelkey- the keyvalue- the value
-
getCasProtocolAuthenticationAttributes
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getCasProtocolAuthenticationAttributes(java.util.Map<java.lang.String,java.lang.Object> model, org.apereo.cas.services.RegisteredService registeredService)Put cas authentication attributes into model.- Parameters:
model- the modelregisteredService- the registered service- Returns:
- the cas authentication attributes
-
prepareViewModelWithAuthenticationPrincipal
protected java.util.Map prepareViewModelWithAuthenticationPrincipal(java.util.Map<java.lang.String,java.lang.Object> model)
Prepare view model with authentication principal.- Parameters:
model- the model- Returns:
- the map
-
prepareCasResponseAttributesForViewModel
protected void prepareCasResponseAttributesForViewModel(java.util.Map<java.lang.String,java.lang.Object> model)
Prepare cas response attributes for view model.- Parameters:
model- the model
-
getCasPrincipalAttributes
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getCasPrincipalAttributes(java.util.Map<java.lang.String,java.lang.Object> model, org.apereo.cas.services.RegisteredService registeredService)Put cas principal attributes into model.- Parameters:
model- the modelregisteredService- the registered service- Returns:
- the cas principal attributes
-
putCasResponseAttributesIntoModel
protected void putCasResponseAttributesIntoModel(java.util.Map<java.lang.String,java.lang.Object> model, java.util.Map<java.lang.String,java.lang.Object> attributes, org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.validation.CasProtocolAttributesRenderer attributesRenderer)Put cas response attributes into model.- Parameters:
model- the modelattributes- the attributesregisteredService- the registered serviceattributesRenderer- the attributes renderer
-
-