public class IndirectBasicAuthClient extends IndirectHttpClient<UsernamePasswordCredentials>
This class is the client to authenticate users through HTTP basic auth. It was previously named: BasicAuthClient
.
For authentication, the user is redirected to the callback url. If the user is not authenticated by basic auth, a
specific exception : RequiresHttpAction
is returned which must be handled by the application to force
authentication.
It returns a HttpProfile
.
HttpProfile
extractor
ATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, callbackUrlResolver, NEEDS_CLIENT_REDIRECTION_PARAMETER
logger
Constructor and Description |
---|
IndirectBasicAuthClient() |
IndirectBasicAuthClient(UsernamePasswordAuthenticator usernamePasswordAuthenticator) |
IndirectBasicAuthClient(UsernamePasswordAuthenticator usernamePasswordAuthenticator,
ProfileCreator profileCreator) |
Modifier and Type | Method and Description |
---|---|
IndirectBasicAuthClient |
clone()
Clone the current client.
|
ClientType |
getClientType()
Return the client type.
|
String |
getRealmName() |
protected void |
internalInit(WebContext context)
Internal initialization of the object.
|
protected boolean |
isDirectRedirection()
Define if this client has a direct redirection.
|
protected IndirectBasicAuthClient |
newClient()
Create a new instance of the client.
|
protected UsernamePasswordCredentials |
retrieveCredentials(WebContext context) |
protected RedirectAction |
retrieveRedirectAction(WebContext context) |
void |
setRealmName(String realmName) |
String |
toString() |
getAuthenticator, getProfileCreator, retrieveUserProfile, setAuthenticator, setProfileCreator
computeFinalCallbackUrl, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCredentials, getRedirectAction, getRedirectionUrl, getStateParameter, isIncludeClientNameInCallbackUrl, redirect, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setIncludeClientNameInCallbackUrl
addAuthorizationGenerator, getAuthorizationGenerators, getName, getUserProfile, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setName
init, reinit
public IndirectBasicAuthClient()
public IndirectBasicAuthClient(UsernamePasswordAuthenticator usernamePasswordAuthenticator)
public IndirectBasicAuthClient(UsernamePasswordAuthenticator usernamePasswordAuthenticator, ProfileCreator profileCreator)
protected void internalInit(WebContext context)
InitializableWebObject
internalInit
in class IndirectHttpClient<UsernamePasswordCredentials>
context
- the web contextpublic IndirectBasicAuthClient clone()
BaseClient
clone
in class IndirectHttpClient<UsernamePasswordCredentials>
protected IndirectBasicAuthClient newClient()
BaseClient
newClient
in class BaseClient<UsernamePasswordCredentials,HttpProfile>
protected RedirectAction retrieveRedirectAction(WebContext context)
retrieveRedirectAction
in class IndirectClient<UsernamePasswordCredentials,HttpProfile>
protected UsernamePasswordCredentials retrieveCredentials(WebContext context) throws RequiresHttpAction
retrieveCredentials
in class IndirectClient<UsernamePasswordCredentials,HttpProfile>
RequiresHttpAction
public String toString()
toString
in class BaseClient<UsernamePasswordCredentials,HttpProfile>
protected boolean isDirectRedirection()
IndirectClient
isDirectRedirection
in class IndirectClient<UsernamePasswordCredentials,HttpProfile>
public ClientType getClientType()
BaseClient
getClientType
in class BaseClient<UsernamePasswordCredentials,HttpProfile>
public String getRealmName()
public void setRealmName(String realmName)
Copyright © 2016. All rights reserved.