public class FormClient extends BaseHttpClient
setLoginUrl(String)
method. For authentication, the user is redirected to
this login form. The username and password inputs must be posted on the callback url. Their names can be defined by using the
setUsernameParameter(String)
and setPasswordParameter(String)
methods.
It returns a HttpProfile
.HttpProfile
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PASSWORD_PARAMETER |
static String |
DEFAULT_USERNAME_PARAMETER |
static String |
ERROR_PARAMETER |
static String |
MISSING_FIELD_ERROR |
usernamePasswordAuthenticator
callbackUrl, logger, NEEDS_CLIENT_REDIRECTION_PARAMETER
Constructor and Description |
---|
FormClient() |
FormClient(String loginUrl,
UsernamePasswordAuthenticator usernamePasswordAuthenticator) |
FormClient(String loginUrl,
UsernamePasswordAuthenticator usernamePasswordAuthenticator,
ProfileCreator profileCreator) |
Modifier and Type | Method and Description |
---|---|
protected String |
computeErrorMessage(TechnicalException e)
Return the error message depending on the thrown exception.
|
String |
getLoginUrl() |
String |
getPasswordParameter() |
String |
getUsernameParameter() |
protected void |
internalInit() |
protected boolean |
isDirectRedirection() |
protected BaseClient<UsernamePasswordCredentials,HttpProfile> |
newClient() |
protected UsernamePasswordCredentials |
retrieveCredentials(WebContext context) |
protected String |
retrieveRedirectionUrl(WebContext context) |
void |
setLoginUrl(String loginUrl) |
void |
setPasswordParameter(String passwordParameter) |
void |
setUsernameParameter(String usernameParameter) |
String |
toString() |
clone, getProfileCreator, getProtocol, getUsernamePasswordAuthenticator, retrieveUserProfile, setProfileCreator, setUsernamePasswordAuthenticator
getCallbackUrl, getCredentials, getName, getRedirectionUrl, getRedirectionUrl, getUserProfile, setCallbackUrl, setName
init, reinit
public static final String ERROR_PARAMETER
public static final String MISSING_FIELD_ERROR
public static final String DEFAULT_USERNAME_PARAMETER
public static final String DEFAULT_PASSWORD_PARAMETER
public FormClient()
public FormClient(String loginUrl, UsernamePasswordAuthenticator usernamePasswordAuthenticator)
public FormClient(String loginUrl, UsernamePasswordAuthenticator usernamePasswordAuthenticator, ProfileCreator profileCreator)
protected BaseClient<UsernamePasswordCredentials,HttpProfile> newClient()
newClient
in class BaseClient<UsernamePasswordCredentials,HttpProfile>
protected void internalInit()
internalInit
in class BaseHttpClient
protected String retrieveRedirectionUrl(WebContext context)
retrieveRedirectionUrl
in class BaseClient<UsernamePasswordCredentials,HttpProfile>
protected UsernamePasswordCredentials retrieveCredentials(WebContext context) throws RequiresHttpAction
retrieveCredentials
in class BaseClient<UsernamePasswordCredentials,HttpProfile>
RequiresHttpAction
protected String computeErrorMessage(TechnicalException e)
e
- public String getLoginUrl()
public void setLoginUrl(String loginUrl)
public String getUsernameParameter()
public void setUsernameParameter(String usernameParameter)
public String getPasswordParameter()
public void setPasswordParameter(String passwordParameter)
public String toString()
toString
in class BaseClient<UsernamePasswordCredentials,HttpProfile>
protected boolean isDirectRedirection()
isDirectRedirection
in class BaseClient<UsernamePasswordCredentials,HttpProfile>
Copyright © 2013. All Rights Reserved.