public class HttpDigestAuthenticationModule extends AbstractAuthenticationModule
Pipe requests. This module
assumes that credentials provided are valid and will never fail on login(java.lang.String, java.lang.String, org.jboss.aerogear.android.core.Callback) or
logout(org.jboss.aerogear.android.core.Callback).
enroll(java.util.Map, org.jboss.aerogear.android.core.Callback) is not
supported and will always fail.PASSWORD_PARAMETER_NAME, THREAD_POOL_EXECUTOR, USERNAME_PARAMETER_NAME| Constructor and Description |
|---|
HttpDigestAuthenticationModule(URL baseURL,
String loginEndpoint,
String logoutEndpoint,
Integer timeout) |
| Modifier and Type | Method and Description |
|---|---|
void |
enroll(Map<String,String> userData,
org.jboss.aerogear.android.core.Callback<org.jboss.aerogear.android.pipe.http.HeaderAndBody> callback)
Will try to register a user with a service using userData.
|
URL |
getBaseURL() |
String |
getEnrollEndpoint() |
String |
getLoginEndpoint() |
String |
getLogoutEndpoint() |
boolean |
handleError(org.jboss.aerogear.android.pipe.http.HttpException exception) |
boolean |
isLoggedIn() |
org.jboss.aerogear.android.pipe.module.ModuleFields |
loadModule(URI relativeURI,
String httpMethod,
byte[] requestBody) |
void |
login(Map<String,String> loginData,
org.jboss.aerogear.android.core.Callback<org.jboss.aerogear.android.pipe.http.HeaderAndBody> callback)
Will try to log in a user
It will call the callbacks onSuccess with a parameter of a Map of the
values returned by the enroll service or onFailure if there is an error
|
void |
login(String username,
String password,
org.jboss.aerogear.android.core.Callback<org.jboss.aerogear.android.pipe.http.HeaderAndBody> callback)
Will try to log in a user using username and password.
|
void |
logout(org.jboss.aerogear.android.core.Callback<Void> callback)
Performs a logout of the current user.
|
public HttpDigestAuthenticationModule(URL baseURL, String loginEndpoint, String logoutEndpoint, Integer timeout)
baseURL - the url that the other endpoints (enroll, login, eyc) will
be appended tologinEndpoint - the login EndpointlogoutEndpoint - the logout Endpointtimeout - the timeoutIllegalArgumentException - if an endpoint can not be appended to
baseURLpublic URL getBaseURL()
public String getLoginEndpoint()
public String getLogoutEndpoint()
public String getEnrollEndpoint()
public void enroll(Map<String,String> userData, org.jboss.aerogear.android.core.Callback<org.jboss.aerogear.android.pipe.http.HeaderAndBody> callback)
AuthenticationModuleenroll in interface AuthenticationModuleenroll in class AbstractAuthenticationModuleuserData - a collection of data to be passed to the server.callback - a callback which will handle the server response.public void login(String username, String password, org.jboss.aerogear.android.core.Callback<org.jboss.aerogear.android.pipe.http.HeaderAndBody> callback)
AuthenticationModulelogin in interface AuthenticationModulelogin in class AbstractAuthenticationModuleusername - the users userNamepassword - the users Passwordcallback - a callback which will handle the server response.public void logout(org.jboss.aerogear.android.core.Callback<Void> callback)
AuthenticationModulelogout in interface AuthenticationModulelogout in class AbstractAuthenticationModulecallback - a callback which will handle the server response.public boolean isLoggedIn()
public void login(Map<String,String> loginData, org.jboss.aerogear.android.core.Callback<org.jboss.aerogear.android.pipe.http.HeaderAndBody> callback)
loginData - a map of data which will be passed to the servercallback - a callback which will handle the server response.public org.jboss.aerogear.android.pipe.module.ModuleFields loadModule(URI relativeURI, String httpMethod, byte[] requestBody)
public boolean handleError(org.jboss.aerogear.android.pipe.http.HttpException exception)
Copyright © 2016 JBoss by Red Hat. All rights reserved.