Class CasClient
- java.lang.Object
-
- org.pac4j.core.util.InitializableObject
-
- org.pac4j.core.client.BaseClient<C>
-
- org.pac4j.core.client.IndirectClient<TokenCredentials>
-
- org.pac4j.cas.client.CasClient
-
- All Implemented Interfaces:
Client<TokenCredentials>
public class CasClient extends IndirectClient<TokenCredentials>
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 aDefaultLogoutHandler
. Usenull
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, aCasProxyProfile
will be return (instead of aCasProfile
) 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
-
-
Constructor Summary
Constructors Constructor Description CasClient()
CasClient(CasConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
clientInit()
CasConfiguration
getConfiguration()
protected CallbackUrlResolver
newDefaultCallbackUrlResolver()
void
notifySessionRenewal(String oldSessionId, WebContext context)
void
setConfiguration(CasConfiguration configuration)
String
toString()
-
Methods inherited from class org.pac4j.core.client.IndirectClient
computeFinalCallbackUrl, defaultLogoutActionBuilder, defaultRedirectionActionBuilder, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCodeVerifierSessionAttributeName, getCredentials, getLogoutAction, getLogoutActionBuilder, getNonceSessionAttributeName, getRedirectionAction, getRedirectionActionBuilder, getStateSessionAttributeName, getUrlResolver, internalInit, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setLogoutActionBuilder, setRedirectionActionBuilder, setUrlResolver
-
Methods inherited from class org.pac4j.core.client.BaseClient
addAuthorizationGenerator, addAuthorizationGenerators, defaultAuthenticator, defaultCredentialsExtractor, defaultProfileCreator, getAuthenticator, getAuthorizationGenerators, getCredentialsExtractor, getCustomProperties, getName, getProfileCreator, getProfileFactoryWhenNotAuthenticated, getUserProfile, renewUserProfile, retrieveCredentials, retrieveUserProfile, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractor, setCustomProperties, setName, setProfileCreator, setProfileFactoryWhenNotAuthenticated
-
Methods inherited from class org.pac4j.core.util.InitializableObject
init, isInitialized
-
-
-
-
Constructor Detail
-
CasClient
public CasClient()
-
CasClient
public CasClient(CasConfiguration configuration)
-
-
Method Detail
-
clientInit
protected void clientInit()
- Specified by:
clientInit
in classIndirectClient<TokenCredentials>
-
newDefaultCallbackUrlResolver
protected CallbackUrlResolver newDefaultCallbackUrlResolver()
- Overrides:
newDefaultCallbackUrlResolver
in classIndirectClient<TokenCredentials>
-
notifySessionRenewal
public void notifySessionRenewal(String oldSessionId, WebContext context)
- Overrides:
notifySessionRenewal
in classBaseClient<TokenCredentials>
-
getConfiguration
public CasConfiguration getConfiguration()
-
setConfiguration
public void setConfiguration(CasConfiguration configuration)
-
toString
public String toString()
- Overrides:
toString
in classIndirectClient<TokenCredentials>
-
-