public abstract class IndirectClient<C extends Credentials,U extends CommonProfile> extends BaseClient<C,U>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTEMPTED_AUTHENTICATION_SUFFIX |
protected java.lang.String |
callbackUrl |
protected UrlResolver |
urlResolver |
logger| Constructor and Description |
|---|
IndirectClient() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
clientInit(WebContext context)
Initialize the client.
|
java.lang.String |
computeFinalCallbackUrl(WebContext context) |
protected void |
defaultLogoutActionBuilder(LogoutActionBuilder<U> logoutActionBuilder) |
protected void |
defaultRedirectActionBuilder(RedirectActionBuilder redirectActionBuilder) |
AjaxRequestResolver |
getAjaxRequestResolver() |
java.lang.String |
getCallbackUrl() |
UrlResolver |
getCallbackUrlResolver()
Deprecated.
|
C |
getCredentials(WebContext context)
Get the credentials from the web context.
|
RedirectAction |
getLogoutAction(WebContext context,
U currentProfile,
java.lang.String targetUrl)
Return the logout action (indirect clients).
|
LogoutActionBuilder<U> |
getLogoutActionBuilder() |
RedirectAction |
getRedirectAction(WebContext context)
Get the redirectAction computed for this client.
|
RedirectActionBuilder |
getRedirectActionBuilder() |
UrlResolver |
getUrlResolver() |
protected void |
internalInit(WebContext context)
Internal initialization of the object.
|
boolean |
isIncludeClientNameInCallbackUrl() |
HttpAction |
redirect(WebContext context)
Redirect to the authentication provider for an indirect client.
|
void |
setAjaxRequestResolver(AjaxRequestResolver ajaxRequestResolver) |
void |
setCallbackUrl(java.lang.String callbackUrl) |
void |
setCallbackUrlResolver(UrlResolver callbackUrlResolver)
Deprecated.
|
void |
setIncludeClientNameInCallbackUrl(boolean includeClientNameInCallbackUrl) |
void |
setLogoutActionBuilder(LogoutActionBuilder<U> logoutActionBuilder) |
void |
setRedirectActionBuilder(RedirectActionBuilder redirectActionBuilder) |
void |
setUrlResolver(UrlResolver urlResolver) |
java.lang.String |
toString() |
addAuthorizationGenerator, addAuthorizationGenerators, defaultAuthenticator, defaultCredentialsExtractor, defaultProfileCreator, getAuthenticator, getAuthorizationGenerators, getCredentialsExtractor, getName, getProfileCreator, getUserProfile, notifySessionRenewal, retrieveCredentials, retrieveUserProfile, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractor, setName, setProfileCreatorinit, reinitpublic static final java.lang.String ATTEMPTED_AUTHENTICATION_SUFFIX
protected java.lang.String callbackUrl
protected UrlResolver urlResolver
protected final void internalInit(WebContext context)
InitializableWebObjectinternalInit in class InitializableWebObjectcontext - the web contextprotected abstract void clientInit(WebContext context)
context - the web contextpublic final HttpAction redirect(WebContext context) throws HttpAction
ClientRedirect 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, java.lang.String targetUrl)
ClientReturn the logout action (indirect clients).
context - the current web contextcurrentProfile - the currentProfiletargetUrl - the target url after logoutpublic java.lang.String computeFinalCallbackUrl(WebContext context)
public boolean isIncludeClientNameInCallbackUrl()
public void setIncludeClientNameInCallbackUrl(boolean includeClientNameInCallbackUrl)
public void setCallbackUrl(java.lang.String callbackUrl)
public java.lang.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 java.lang.String toString()
toString in class BaseClient<C extends Credentials,U extends CommonProfile>Copyright © 2018. All Rights Reserved.