public class CasClient extends IndirectClient<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 String |
encoding |
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, callbackUrlResolver, NEEDS_CLIENT_REDIRECTION_PARAMETER
Constructor and Description |
---|
CasClient() |
CasClient(String casLoginUrl) |
CasClient(String casLoginUrl,
CasClient.CasProtocol casProtocol) |
CasClient(String casLoginUrl,
String casPrefixUrl) |
Modifier and Type | Method and Description |
---|---|
org.jasig.cas.client.validation.ProxyList |
getAllowedProxyChains() |
String |
getCasLoginUrl() |
String |
getCasPrefixUrl() |
CasClient.CasProtocol |
getCasProtocol() |
CasProxyReceptor |
getCasProxyReceptor() |
ClientType |
getClientType()
Return the client type.
|
String |
getEncoding() |
LogoutHandler |
getLogoutHandler() |
long |
getTimeTolerance() |
protected void |
initializeCas10Protocol() |
protected void |
initializeCas20Protocol(WebContext context) |
protected void |
initializeCas20ProxyProtocol(WebContext context) |
protected void |
initializeCas30Protocol(WebContext context) |
protected void |
initializeCas30ProxyProtocol(WebContext context) |
protected void |
initializeClientConfiguration(WebContext context) |
protected void |
initializeSAMLProtocol() |
protected void |
internalInit(WebContext context)
Internal initialization of the object.
|
boolean |
isAcceptAnyProxy() |
protected boolean |
isDirectRedirection()
Define if this client has a direct redirection.
|
boolean |
isGateway() |
boolean |
isRenew() |
protected IndirectClient<CasCredentials,CasProfile> |
newClient()
Create a new instance of the client.
|
protected CasCredentials |
retrieveCredentials(WebContext context)
Get the credentials from the web context.
|
protected RedirectAction |
retrieveRedirectAction(WebContext context)
Get the redirection url.
|
protected CasProfile |
retrieveUserProfile(CasCredentials credentials,
WebContext context)
Get the user profile from the credentials.
|
void |
setAcceptAnyProxy(boolean acceptAnyProxy) |
void |
setAllowedProxyChains(org.jasig.cas.client.validation.ProxyList allowedProxyChains) |
void |
setCasLoginUrl(String casLoginUrl) |
void |
setCasPrefixUrl(String casPrefixUrl) |
void |
setCasProtocol(CasClient.CasProtocol casProtocol) |
void |
setCasProxyReceptor(CasProxyReceptor casProxyReceptor) |
void |
setEncoding(String encoding) |
void |
setGateway(boolean gateway) |
void |
setLogoutHandler(LogoutHandler logoutHandler) |
void |
setRenew(boolean renew) |
void |
setTimeTolerance(long timeTolerance) |
String |
toString() |
computeFinalCallbackUrl, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCredentials, getRedirectAction, getRedirectionUrl, getStateParameter, isIncludeClientNameInCallbackUrl, redirect, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setIncludeClientNameInCallbackUrl
addAuthorizationGenerator, clone, getAuthorizationGenerators, getName, getUserProfile, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setName
init, reinit
protected 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 encoding
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
public CasClient()
public CasClient(String casLoginUrl)
public CasClient(String casLoginUrl, CasClient.CasProtocol casProtocol)
protected RedirectAction retrieveRedirectAction(WebContext context)
retrieveRedirectAction
in class IndirectClient<CasCredentials,CasProfile>
context
- the web contextprotected IndirectClient<CasCredentials,CasProfile> newClient()
BaseClient
newClient
in class BaseClient<CasCredentials,CasProfile>
protected void internalInit(WebContext context)
InitializableWebObject
internalInit
in class InitializableWebObject
context
- the web contextprotected void initializeSAMLProtocol()
protected void initializeCas30ProxyProtocol(WebContext context)
protected void initializeCas30Protocol(WebContext context)
protected void initializeCas20ProxyProtocol(WebContext context)
protected void initializeCas20Protocol(WebContext context)
protected void initializeCas10Protocol()
protected void initializeClientConfiguration(WebContext context)
protected CasCredentials retrieveCredentials(WebContext context) throws RequiresHttpAction
retrieveCredentials
in class IndirectClient<CasCredentials,CasProfile>
context
- the web contextRequiresHttpAction
- requires an extra HTTP actionprotected CasProfile retrieveUserProfile(CasCredentials credentials, WebContext context)
retrieveUserProfile
in class BaseClient<CasCredentials,CasProfile>
credentials
- the CAS credentialspublic 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 getEncoding()
public void setEncoding(String encoding)
public String toString()
toString
in class BaseClient<CasCredentials,CasProfile>
protected boolean isDirectRedirection()
IndirectClient
isDirectRedirection
in class IndirectClient<CasCredentials,CasProfile>
public ClientType getClientType()
BaseClient
getClientType
in class BaseClient<CasCredentials,CasProfile>
Copyright © 2016. All rights reserved.