Class 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.AbstractView
    Abstract 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.CasProtocolAttributesRenderer attributesRenderer
      CAS attribute renderer.
      protected org.apereo.cas.validation.AuthenticationAttributeReleasePolicy authenticationAttributeReleasePolicy
      Authentication attribute release policy.
      protected org.apereo.cas.authentication.AuthenticationServiceSelectionPlan authenticationRequestServiceSelectionStrategies
      The Service selection strategy.
      protected org.apereo.cas.authentication.ProtocolAttributeEncoder protocolAttributeEncoder
      The attribute encoder instance.
      protected org.apereo.cas.services.ServicesManager servicesManager
      The Services manager.
      protected boolean successResponse
      Indicate whether this view will be generating the success response or not.
      • Fields inherited from class org.springframework.web.servlet.view.AbstractView

        DEFAULT_CONTENT_TYPE
      • Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

        logger
      • Fields inherited from interface org.springframework.web.servlet.View

        PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractCasView()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.apereo.cas.validation.Assertion getAssertionFrom​(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.String getErrorCodeFrom​(java.util.Map<java.lang.String,​java.lang.Object> model)
      Gets error code from.
      protected java.lang.String getErrorDescriptionFrom​(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.Authentication getPrimaryAuthenticationFrom​(java.util.Map<java.lang.String,​java.lang.Object> model)
      Gets the authentication from the model.
      protected org.apereo.cas.authentication.principal.Principal getPrincipal​(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.String getProxyGrantingTicketIou​(java.util.Map<java.lang.String,​java.lang.Object> model)
      Gets the PGT-IOU from the model.
      protected org.apereo.cas.authentication.principal.WebApplicationService getServiceFrom​(java.util.Map<java.lang.String,​java.lang.Object> model)
      Gets validated service from the model.
      protected void prepareCasResponseAttributesForViewModel​(java.util.Map<java.lang.String,​java.lang.Object> model)
      Prepare cas response attributes for view model.
      protected java.util.Map prepareViewModelWithAuthenticationPrincipal​(java.util.Map<java.lang.String,​java.lang.Object> model)
      Prepare view model with authentication principal.
      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.
      protected void putIntoModel​(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
      • Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

        getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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.
    • Constructor Detail

      • AbstractCasView

        public AbstractCasView()
    • 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 model
        key - the key
        value - 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 model
        registeredService - 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 model
        registeredService - 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 model
        attributes - the attributes
        registeredService - the registered service
        attributesRenderer - the attributes renderer