public class SupportAuthenticationModuleAdapter extends Object implements LoaderAuthenticationModule, android.support.v4.app.LoaderManager.LoaderCallbacks<HeaderAndBody>
AuthenticationModule instance.
This class uses the Android support versions of the Loader API. If you do not
need to support devices < Android 3.0, see
AuthenticationModuleAdapter| Modifier and Type | Class and Description |
|---|---|
static class |
SupportAuthenticationModuleAdapter.Methods |
| Constructor and Description |
|---|
SupportAuthenticationModuleAdapter(android.support.v4.app.FragmentActivity activity,
AuthenticationModule module,
String name) |
SupportAuthenticationModuleAdapter(android.support.v4.app.Fragment fragment,
android.content.Context applicationContext,
AuthenticationModule module,
String name) |
| Modifier and Type | Method and Description |
|---|---|
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(Map<String,String> loginData,
Callback<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,
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.
|
android.support.v4.content.Loader<HeaderAndBody> |
onCreateLoader(int id,
android.os.Bundle bundle) |
void |
onLoaderReset(android.support.v4.content.Loader<HeaderAndBody> loader) |
void |
onLoadFinished(android.support.v4.content.Loader<HeaderAndBody> loader,
HeaderAndBody data)
This method will call the Callback for a enroll, login, or logout method
on the main thread of the application.
|
boolean |
retryLogin()
Some authorization schemes (HTTP Digest, OAUTH) have a mechanism for retrying
a login to fetch fresh credentials after the credentials expire.
|
public SupportAuthenticationModuleAdapter(android.support.v4.app.FragmentActivity activity,
AuthenticationModule module,
String name)
public SupportAuthenticationModuleAdapter(android.support.v4.app.Fragment fragment,
android.content.Context applicationContext,
AuthenticationModule module,
String name)
public URL getBaseURL()
getBaseURL in interface AuthenticationModulepublic String getLoginEndpoint()
getLoginEndpoint in interface AuthenticationModulepublic String getLogoutEndpoint()
getLogoutEndpoint in interface AuthenticationModulepublic String getEnrollEndpoint()
getEnrollEndpoint in interface AuthenticationModulepublic void enroll(Map<String,String> userData, Callback<HeaderAndBody> callback)
AuthenticationModuleenroll in interface AuthenticationModulepublic void login(String username, String password, Callback<HeaderAndBody> callback)
AuthenticationModulelogin in interface AuthenticationModulepublic void login(Map<String,String> loginData, Callback<HeaderAndBody> callback)
AuthenticationModulelogin in interface AuthenticationModulepublic void logout(Callback<Void> callback)
AuthenticationModulelogout in interface AuthenticationModulepublic boolean isLoggedIn()
isLoggedIn in interface AuthenticationModulepublic 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.getAuthorizationFields in interface AuthenticationModulepublic 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.getAuthorizationFields in interface AuthenticationModulerequestUri - 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()
AuthenticationModuleretryLogin in interface AuthenticationModulepublic android.support.v4.content.Loader<HeaderAndBody> onCreateLoader(int id, android.os.Bundle bundle)
onCreateLoader in interface android.support.v4.app.LoaderManager.LoaderCallbacks<HeaderAndBody>public void onLoadFinished(android.support.v4.content.Loader<HeaderAndBody> loader, HeaderAndBody data)
AbstractSupportFragmentCallback or
AbstractFragmentActivityCallback then it will also configure the
reference to Fragment or FragmentActivity for the
callback.onLoadFinished in interface android.support.v4.app.LoaderManager.LoaderCallbacks<HeaderAndBody>public void onLoaderReset(android.support.v4.content.Loader<HeaderAndBody> loader)
onLoaderReset in interface android.support.v4.app.LoaderManager.LoaderCallbacks<HeaderAndBody>Copyright © 2013 JBoss by Red Hat. All Rights Reserved.