Class CasClient

  • All Implemented Interfaces:
    org.pac4j.core.client.Client

    public class CasClient
    extends org.pac4j.core.client.IndirectClient

    This class is the client to authenticate users on a CAS server for a web application in a stateful way: when trying to access a protected area, the user will be redirected to the CAS server for login and then back to the application (on the callback endpoint) and finally to the originally requested url.

    The configuration can be defined via the configuration object.

    By default, the LogoutHandler will be a DefaultLogoutHandler. Use null to disable logout support.

    For proxy support, a CasProxyReceptor must be defined in the configuration (the corresponding "callback filter" must be enabled) and set to the CAS configuration of this client. In that case, a CasProxyProfile will be return (instead of a CasProfile) to be able to request proxy tickets.

    Since:
    1.4.0
    Author:
    Jerome Leleu
    • Field Summary

      • Fields inherited from class org.pac4j.core.client.IndirectClient

        ATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, callbackUrlResolver, urlResolver
      • Fields inherited from class org.pac4j.core.client.BaseClient

        logger, saveProfileInSession
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CasConfiguration getConfiguration()  
      protected void internalInit()  
      protected org.pac4j.core.http.callback.CallbackUrlResolver newDefaultCallbackUrlResolver()  
      void notifySessionRenewal​(java.lang.String oldSessionId, org.pac4j.core.context.WebContext context, org.pac4j.core.context.session.SessionStore sessionStore)  
      void setConfiguration​(CasConfiguration configuration)  
      java.lang.String toString()  
      • Methods inherited from class org.pac4j.core.client.IndirectClient

        afterInternalInit, beforeInternalInit, computeFinalCallbackUrl, defaultLogoutActionBuilder, defaultRedirectionActionBuilder, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCodeVerifierSessionAttributeName, getCredentials, getLogoutAction, getLogoutActionBuilder, getNonceSessionAttributeName, getRedirectionAction, getRedirectionActionBuilder, getStateSessionAttributeName, getUrlResolver, isCheckAuthenticationAttempt, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setCheckAuthenticationAttempt, setLogoutActionBuilder, setRedirectionActionBuilder, setUrlResolver
      • Methods inherited from class org.pac4j.core.client.BaseClient

        addAuthorizationGenerator, addAuthorizationGenerators, defaultAuthenticator, defaultCredentialsExtractor, defaultProfileCreator, getAuthenticator, getAuthorizationGenerators, getCredentialsExtractor, getCustomProperties, getName, getProfileCreator, getProfileFactoryWhenNotAuthenticated, getSaveProfileInSession, getUserProfile, isMultiProfile, renewUserProfile, retrieveCredentials, retrieveUserProfile, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractor, setCustomProperties, setMultiProfile, setName, setProfileCreator, setProfileFactoryWhenNotAuthenticated, setSaveProfileInSession
      • Methods inherited from class org.pac4j.core.util.InitializableObject

        init, isInitialized
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CasClient

        public CasClient()
    • Method Detail

      • internalInit

        protected void internalInit()
        Specified by:
        internalInit in class org.pac4j.core.util.InitializableObject
      • newDefaultCallbackUrlResolver

        protected org.pac4j.core.http.callback.CallbackUrlResolver newDefaultCallbackUrlResolver()
        Overrides:
        newDefaultCallbackUrlResolver in class org.pac4j.core.client.IndirectClient
      • notifySessionRenewal

        public void notifySessionRenewal​(java.lang.String oldSessionId,
                                         org.pac4j.core.context.WebContext context,
                                         org.pac4j.core.context.session.SessionStore sessionStore)
        Overrides:
        notifySessionRenewal in class org.pac4j.core.client.BaseClient
      • setConfiguration

        public void setConfiguration​(CasConfiguration configuration)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class org.pac4j.core.client.IndirectClient