public abstract class IndirectClient<C extends Credentials,U extends CommonProfile> extends BaseClient<C,U>
Modifier and Type | Field and Description |
---|---|
static String |
ATTEMPTED_AUTHENTICATION_SUFFIX |
protected String |
callbackUrl |
protected UrlResolver |
urlResolver |
logger
Constructor and Description |
---|
IndirectClient() |
addAuthorizationGenerator, addAuthorizationGenerators, defaultAuthenticator, defaultCredentialsExtractor, defaultProfileCreator, getAuthenticator, getAuthorizationGenerators, getCredentialsExtractor, getName, getProfileCreator, getUserProfile, notifySessionRenewal, retrieveCredentials, retrieveUserProfile, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractor, setName, setProfileCreator
init, reinit
public static final String ATTEMPTED_AUTHENTICATION_SUFFIX
protected String callbackUrl
protected UrlResolver urlResolver
protected final void internalInit(WebContext context)
InitializableWebObject
internalInit
in class InitializableWebObject
context
- the web contextprotected abstract void clientInit(WebContext context)
context
- the web contextpublic final HttpAction redirect(WebContext context) throws HttpAction
Client
Redirect to the authentication provider for an indirect client.
context
- the current web contextHttpAction
- whether an additional HTTP action is requiredpublic RedirectAction getRedirectAction(WebContext context) throws HttpAction
Get the redirectAction computed for this client. All the logic is encapsulated here. It should not be called be directly, the
redirect(WebContext)
should be generally called instead.
If an authentication has already been tried for this client and has failed (null
credentials) or if the request is an AJAX one,
an authorized response (401 HTTP status code) is returned instead of a redirection.
context
- contextHttpAction
- requires an additional HTTP actionpublic final C getCredentials(WebContext context) throws HttpAction
Get the credentials from the web context. In some cases, a HttpAction
may be thrown:
CasClient
receives a logout request, it returns a 200 HTTP status codeIndirectBasicAuthClient
, if no credentials are sent to the callback url, an unauthorized response (401 HTTP status
code) is returned to request credentials through a popup.context
- the current web contextHttpAction
- whether an additional HTTP action is requiredpublic final RedirectAction getLogoutAction(WebContext context, U currentProfile, String targetUrl)
Client
Return the logout action (indirect clients).
context
- the current web contextcurrentProfile
- the currentProfiletargetUrl
- the target url after logoutpublic String computeFinalCallbackUrl(WebContext context)
public boolean isIncludeClientNameInCallbackUrl()
public void setIncludeClientNameInCallbackUrl(boolean includeClientNameInCallbackUrl)
public void setCallbackUrl(String callbackUrl)
public String getCallbackUrl()
@Deprecated public UrlResolver getCallbackUrlResolver()
getUrlResolver()
instead.@Deprecated public void setCallbackUrlResolver(UrlResolver callbackUrlResolver)
setUrlResolver(UrlResolver)
instead.callbackUrlResolver
- the URL resolver for the callback URLpublic UrlResolver getUrlResolver()
public void setUrlResolver(UrlResolver urlResolver)
public AjaxRequestResolver getAjaxRequestResolver()
public void setAjaxRequestResolver(AjaxRequestResolver ajaxRequestResolver)
public RedirectActionBuilder getRedirectActionBuilder()
protected void defaultRedirectActionBuilder(RedirectActionBuilder redirectActionBuilder)
public LogoutActionBuilder<U> getLogoutActionBuilder()
protected void defaultLogoutActionBuilder(LogoutActionBuilder<U> logoutActionBuilder)
public void setRedirectActionBuilder(RedirectActionBuilder redirectActionBuilder)
public void setLogoutActionBuilder(LogoutActionBuilder<U> logoutActionBuilder)
public String toString()
toString
in class BaseClient<C extends Credentials,U extends CommonProfile>
Copyright © 2017. All rights reserved.