Class CasClient

java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.core.client.BaseClient
org.pac4j.core.client.IndirectClient
org.pac4j.cas.client.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 SessionLogoutHandler will be a DefaultSessionLogoutHandler. 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
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for CasClient.
    CasClient(CasConfiguration configuration)
    Constructor for CasClient.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    internalInit(boolean forceReinit)
    protected org.pac4j.core.http.callback.CallbackUrlResolver
    void
    notifySessionRenewal(org.pac4j.core.context.CallContext ctx, String oldSessionId)

    Methods inherited from class org.pac4j.core.client.IndirectClient

    afterInternalInit, beforeInternalInit, checkCredentials, computeFinalCallbackUrl, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCodeVerifierSessionAttributeName, getLogoutAction, getLogoutActionBuilder, getLogoutProcessor, getNonceSessionAttributeName, getRedirectionAction, getRedirectionActionBuilder, getStateSessionAttributeName, getUrlResolver, isCheckAuthenticationAttempt, processLogout, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setCheckAuthenticationAttempt, setLogoutActionBuilder, setLogoutActionBuilderIfUndefined, setLogoutProcessor, setLogoutProcessorIfUndefined, setRedirectionActionBuilder, setRedirectionActionBuilderIfUndefined, setUrlResolver, toString

    Methods inherited from class org.pac4j.core.client.BaseClient

    addAuthorizationGenerator, addAuthorizationGenerators, findSessionLogoutHandler, getAuthenticator, getAuthorizationGenerators, getConfig, getCredentials, getCredentialsExtractor, getCustomProperties, getLogger, getName, getProfileCreator, getProfileFactoryWhenNotAuthenticated, getSaveProfileInSession, getSaveProfileInSession, getUserProfile, internalValidateCredentials, isMultiProfile, isMultiProfile, renewUserProfile, setAuthenticator, setAuthenticatorIfUndefined, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setConfig, setCredentialsExtractor, setCredentialsExtractorIfUndefined, setCustomProperties, setMultiProfile, setName, setProfileCreator, setProfileCreatorIfUndefined, setProfileFactoryWhenNotAuthenticated, setSaveProfileInSession, validateCredentials

    Methods inherited from class org.pac4j.core.util.InitializableObject

    getInitialized, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize

    Methods inherited from class java.lang.Object

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

    • CasClient

      public CasClient()

      Constructor for CasClient.

    • CasClient

      public CasClient(CasConfiguration configuration)

      Constructor for CasClient.

      Parameters:
      configuration - a CasConfiguration object
  • Method Details

    • internalInit

      protected void internalInit(boolean forceReinit)
      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(org.pac4j.core.context.CallContext ctx, String oldSessionId)
      Overrides:
      notifySessionRenewal in class org.pac4j.core.client.BaseClient