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 CallbackUrlResolver |
callbackUrlResolver |
protected UrlResolver |
urlResolver |
logger| Constructor and Description |
|---|
IndirectClient() |
addAuthorizationGenerator, addAuthorizationGenerators, defaultAuthenticator, defaultCredentialsExtractor, defaultProfileCreator, getAuthenticator, getAuthorizationGenerators, getCredentialsExtractor, getCustomProperties, getName, getProfileCreator, getUserProfile, notifySessionRenewal, retrieveCredentials, retrieveUserProfile, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractor, setCustomProperties, setName, setProfileCreatorinitpublic static final String ATTEMPTED_AUTHENTICATION_SUFFIX
protected String callbackUrl
protected UrlResolver urlResolver
protected CallbackUrlResolver callbackUrlResolver
protected final void internalInit()
InitializableObjectinternalInit in class InitializableObjectprotected CallbackUrlResolver newDefaultCallbackUrlResolver()
protected abstract void clientInit()
public final HttpAction redirect(WebContext context)
ClientRedirect to the authentication provider for an indirect client.
context - the current web contextpublic RedirectAction getRedirectAction(WebContext context)
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 - contextpublic final C getCredentials(WebContext context)
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 contextpublic final RedirectAction getLogoutAction(WebContext context, U currentProfile, String targetUrl)
ClientReturn the logout action (indirect clients).
context - the current web contextcurrentProfile - the currentProfiletargetUrl - the target url after logoutpublic String computeFinalCallbackUrl(WebContext context)
public void setCallbackUrl(String callbackUrl)
public String getCallbackUrl()
public UrlResolver getUrlResolver()
public void setUrlResolver(UrlResolver urlResolver)
public CallbackUrlResolver getCallbackUrlResolver()
public void setCallbackUrlResolver(CallbackUrlResolver callbackUrlResolver)
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 © 2019. All rights reserved.