public class ChannelAuthUserPass extends java.lang.Object implements ChannelAuth
| Constructor and Description |
|---|
ChannelAuthUserPass(java.lang.String base,
java.lang.String username,
java.lang.String password,
java.lang.String pathFragment,
java.lang.String verifyCertBundle,
HttpProxySettings httpProxySettings) |
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate(org.apache.http.HttpRequest httpRequest)
Adds the http header with the Authorization token to the given http request
|
void |
reset()
Purge any credentials cached from a previous authentication.
|
public ChannelAuthUserPass(java.lang.String base,
java.lang.String username,
java.lang.String password,
java.lang.String pathFragment,
java.lang.String verifyCertBundle,
HttpProxySettings httpProxySettings)
throws PermanentError
base - Base URL to forward authentication requests to. Its value will be prepended to pathFragment.username - User name to supply for request authentication.password - Password to supply for request authentication.pathFragment - Path to append to the base URL for the request.verifyCertBundle - CA Bundle chain certificates. This string shall be either the certificates themselves or
a path to a CA bundle file containing those certificates. The CA bundle is used to
validate that the certificate of the authentication server being connected to was signed
by a valid authority. If set to an empty string, the server certificate will not be
validated.httpProxySettings - http proxy url, port, username and passwordPermanentError - if base is null or empty or if username is null or empty or if password is nullpublic void reset()
reset in interface ChannelAuthpublic void authenticate(org.apache.http.HttpRequest httpRequest)
throws PermanentError,
TemporaryError
authenticate in interface ChannelAuthhttpRequest - request where to add the Authorization headerPermanentError - if the request fails due to the user not being authenticated successfully or if the user
is unauthorized to make the request or if a non-recoverable authentication error occurs for the request.TemporaryError - if an unexpected (but possibly recoverable) authentication error occurs for the request.