public class CasClient extends BaseClient<CasCredentials,CasProfile>
This class is the client to authenticate users on a CAS server.
The CAS service url is defined by the callback url which must be defined on the services back office of the CAS server.
The CAS server login url is defined by the setCasLoginUrl(String) method and the CAS server prefix url is settable by the
setCasPrefixUrl(String) method. If the CAS prefix url is not defined, the CAS prefix url is computed from the CAS server login
url and vice versa.
The CAS protocol is defined by the setCasProtocol(CasProtocol) method and CasClient.CasProtocol enumeration. It can be :
setAcceptAnyProxy(boolean) method or the list of accepted proxies by using the setAllowedProxyChains(ProxyList) method.
For the CAS round-trip :
renew parameter can be set by using the setRenew(boolean) methodgateway parameter can be set by using the setGateway(boolean) method.This client handles CAS logout calls from the CAS server, using the LogoutHandler interface. It's defined by default as the
NoLogoutHandler class, which does not perform the logout. Though, in J2E context, it can be defined to the
CasSingleSignOutHandler class by using the setLogoutHandler(LogoutHandler) method. It must be used in association with
the CAS client listener : SingleSignOutHttpSessionListener.
To require a proxy granting ticket, the CasProxyReceptor class must be used and referenced in this class through the
setCasProxyReceptor(CasProxyReceptor) method.
It returns a CasProfile or a CasProxyProfile if the
casProxyReceptor is defined (this CAS client acts as a proxy).
CasProfile| Modifier and Type | Class and Description |
|---|---|
static class |
CasClient.CasProtocol |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
acceptAnyProxy |
protected org.jasig.cas.client.validation.ProxyList |
allowedProxyChains |
protected String |
casLoginUrl |
protected String |
casPrefixUrl |
protected CasClient.CasProtocol |
casProtocol |
protected CasProxyReceptor |
casProxyReceptor |
protected boolean |
gateway |
protected static org.slf4j.Logger |
logger |
protected LogoutHandler |
logoutHandler |
protected boolean |
renew |
protected static String |
SERVICE_PARAMETER |
static String |
SERVICE_TICKET_PARAMETER |
protected org.jasig.cas.client.validation.TicketValidator |
ticketValidator |
protected long |
timeTolerance |
ATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, NEEDS_CLIENT_REDIRECTION_PARAMETER| Constructor and Description |
|---|
CasClient() |
addAuthorizationGenerator, clone, getAuthenticator, getAuthorizationGenerators, getCallbackUrl, getContextualCallbackUrl, getCredentials, getName, getProfileCreator, getRedirectAction, getRedirectionUrl, getStateParameter, getUserProfile, isEnableContextualRedirects, prependHostToUrlIfNotPresent, redirect, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setCallbackUrl, setEnableContextualRedirects, setName, setProfileCreatorinit, reinitprotected static final org.slf4j.Logger logger
protected static final String SERVICE_PARAMETER
public static final String SERVICE_TICKET_PARAMETER
protected LogoutHandler logoutHandler
protected org.jasig.cas.client.validation.TicketValidator ticketValidator
protected String casLoginUrl
protected String casPrefixUrl
protected long timeTolerance
protected CasClient.CasProtocol casProtocol
protected boolean renew
protected boolean gateway
protected boolean acceptAnyProxy
protected org.jasig.cas.client.validation.ProxyList allowedProxyChains
protected CasProxyReceptor casProxyReceptor
protected RedirectAction retrieveRedirectAction(WebContext context)
retrieveRedirectAction in class BaseClient<CasCredentials,CasProfile>context - protected BaseClient<CasCredentials,CasProfile> newClient()
newClient in class BaseClient<CasCredentials,CasProfile>protected void internalInit()
internalInit in class InitializableObjectprotected CasCredentials retrieveCredentials(WebContext context) throws RequiresHttpAction
retrieveCredentials in class BaseClient<CasCredentials,CasProfile>context - RequiresHttpActionprotected CasProfile retrieveUserProfile(CasCredentials credentials, WebContext context)
retrieveUserProfile in class BaseClient<CasCredentials,CasProfile>credentials - public String getCasLoginUrl()
public void setCasLoginUrl(String casLoginUrl)
public String getCasPrefixUrl()
public void setCasPrefixUrl(String casPrefixUrl)
public CasClient.CasProtocol getCasProtocol()
public void setCasProtocol(CasClient.CasProtocol casProtocol)
public boolean isRenew()
public void setRenew(boolean renew)
public boolean isGateway()
public void setGateway(boolean gateway)
public LogoutHandler getLogoutHandler()
public void setLogoutHandler(LogoutHandler logoutHandler)
public boolean isAcceptAnyProxy()
public void setAcceptAnyProxy(boolean acceptAnyProxy)
public org.jasig.cas.client.validation.ProxyList getAllowedProxyChains()
public void setAllowedProxyChains(org.jasig.cas.client.validation.ProxyList allowedProxyChains)
public CasProxyReceptor getCasProxyReceptor()
public void setCasProxyReceptor(CasProxyReceptor casProxyReceptor)
public long getTimeTolerance()
public void setTimeTolerance(long timeTolerance)
public String toString()
toString in class BaseClient<CasCredentials,CasProfile>protected boolean isDirectRedirection()
isDirectRedirection in class BaseClient<CasCredentials,CasProfile>public Mechanism getMechanism()
getMechanism in class BaseClient<CasCredentials,CasProfile>Copyright © 2015. All Rights Reserved.