|
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.HttpBasicAuthenticationModule
public class HttpBasicAuthenticationModule
This class provides Authentication using HTTP Basic
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 | |
|---|---|
HttpBasicAuthenticationModule(URL baseURL)
|
|
| Method Summary | |
|---|---|
void |
enroll(Map<String,String> userData,
Callback<HeaderAndBody> callback)
Enrolling is not supported using http basic. |
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)
This method stores username and password. |
void |
logout(Callback<Void> callback)
This method clears the username and password from the module, sets isLoggedIn to false, and removes all cookies associated with baseURL
This method always calls Callback.onSuccess(java.lang.Object) |
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 HttpBasicAuthenticationModule(URL baseURL)
baseURL - The base URL shared by a Pipe.| Method Detail |
|---|
public URL getBaseURL()
public String getLoginEndpoint()
public String getLogoutEndpoint()
public String getEnrollEndpoint()
public boolean isLoggedIn()
public void login(String username,
String password,
Callback<HeaderAndBody> callback)
isLoggedIn to true and calls Callback.onSuccess(java.lang.Object).
login in interface AuthenticationModulelogin in class AbstractAuthenticationModuleusername - password - callback - public void logout(Callback<Void> callback)
baseURL
This method always calls Callback.onSuccess(java.lang.Object)
logout in interface AuthenticationModulelogout in class AbstractAuthenticationModulecallback -
public void enroll(Map<String,String> userData,
Callback<HeaderAndBody> callback)
Callback.onFailure(java.lang.Exception) and pass
it a UnsupportedOperationException.
enroll in interface AuthenticationModuleenroll in class AbstractAuthenticationModuleuserData - this value is ignored.callback - 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 | |||||||||