|
AeroGear Android Library 1.1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.aerogear.android.authentication.AbstractAuthenticationModule
org.jboss.aerogear.android.authentication.impl.HttpDigestAuthenticationModule
public class HttpDigestAuthenticationModule
This class provides Authentication using HTTP Digest
As per the HTTP RFC this
class will cache credentials and consumed by 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.Callback)
or AGSecurityAuthenticationModule.logout(org.jboss.aerogear.android.Callback).
enroll(java.util.Map, org.jboss.aerogear.android.Callback) is not
supported and will always fail.
| Field Summary |
|---|
| Fields inherited from class org.jboss.aerogear.android.authentication.AbstractAuthenticationModule |
|---|
THREAD_POOL_EXECUTOR |
| Constructor Summary | |
|---|---|
HttpDigestAuthenticationModule(URL baseURL,
AuthenticationConfig config)
|
|
| Method Summary | |
|---|---|
void |
enroll(Map<String,String> userData,
Callback<HeaderAndBody> callback)
Will try to register a user with a service using userData. |
AuthorizationFields |
getAuthorizationFields()
This method is called be Pipe implementations when they need
security applied to their HttpProvider. |
AuthorizationFields |
getAuthorizationFields(URI requestUri,
String method,
byte[] requestBody)
This method is called be Pipe implementations when they need
security applied to their HttpProvider. |
URL |
getBaseURL()
|
String |
getEnrollEndpoint()
|
String |
getLoginEndpoint()
|
String |
getLogoutEndpoint()
|
boolean |
isLoggedIn()
|
void |
login(String username,
String password,
Callback<HeaderAndBody> callback)
Will try to log in a user using username and password. |
void |
logout(Callback<Void> callback)
Performs a logout of the current user. |
boolean |
retryLogin()
Some authorization schemes (HTTP Digest, OAUTH) have a mechanism for retrying a login to fetch fresh credentials after the credentials expire. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpDigestAuthenticationModule(URL baseURL,
AuthenticationConfig config)
baseURL - config -
IllegalArgumentException - if an endpoint can not be appended to
baseURL| Method Detail |
|---|
public URL getBaseURL()
public String getLoginEndpoint()
public String getLogoutEndpoint()
public String getEnrollEndpoint()
public void enroll(Map<String,String> userData,
Callback<HeaderAndBody> callback)
AuthenticationModule
enroll in interface AuthenticationModuleenroll in class AbstractAuthenticationModule
public void login(String username,
String password,
Callback<HeaderAndBody> callback)
AuthenticationModule
login in interface AuthenticationModulelogin in class AbstractAuthenticationModulepublic void logout(Callback<Void> callback)
AuthenticationModule
logout in interface AuthenticationModulelogout in class AbstractAuthenticationModulepublic boolean isLoggedIn()
public AuthorizationFields getAuthorizationFields()
AuthenticationModulePipe implementations when they need
security applied to their HttpProvider. The headers/data/query
parameters returned should be applied to the Url and HttpProvider
directly before a call.
public AuthorizationFields getAuthorizationFields(URI requestUri,
String method,
byte[] requestBody)
AuthenticationModulePipe implementations when they need
security applied to their HttpProvider. The headers/data/query
parameters returned should be applied to the Url and HttpProvider
directly before a call.
requestUri - the Request-Line URI.method - the HTTP method being usedrequestBody - the body of the request. This method promises to not
modify the body.
public boolean retryLogin()
AuthenticationModule
|
AeroGear Android Library 1.1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||