public abstract class OAuth2AuthzModule extends Object implements AuthzModule
| Modifier and Type | Field and Description |
|---|---|
protected OAuth2AuthzSession |
account |
protected String |
accountId |
protected String |
clientId |
protected OAuth2Properties |
config |
protected OAuth2AuthzService |
service |
String |
TAG |
| Constructor and Description |
|---|
OAuth2AuthzModule(OAuth2Properties config) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteAccount()
This will remove all information about the account with the Module's
AccountId
|
org.jboss.aerogear.android.pipe.module.AuthorizationFields |
getAuthorizationFields(URI requestUri,
String method,
byte[] requestBody)
This method is called be
Pipe implementations when they need
security applied to their HttpProvider. |
boolean |
handleError(org.jboss.aerogear.android.pipe.http.HttpException exception) |
protected boolean |
hasAccount() |
boolean |
hasCredentials()
This function checks if a module has all of the necessary information to
make a authorized request.
|
boolean |
isAuthorized()
If a module is Authorized that means that it can be used to provide
authorization meta-data to calling code.
|
protected boolean |
isNullOrEmpty(String testString) |
org.jboss.aerogear.android.pipe.module.ModuleFields |
loadModule(URI relativeURI,
String httpMethod,
byte[] requestBody) |
boolean |
refreshAccess()
Refreshing access will synchronously check the current of the tokens and
refresh them if necessary.
|
protected void |
removeAccount()
Removes the account used in the module.
|
abstract void |
requestAccess(android.app.Activity activity,
org.jboss.aerogear.android.core.Callback<String> callback)
Begin requesting access for the application.
|
protected void |
setAccount(OAuth2AuthzSession account)
Sets the account used in the module.
|
protected final String accountId
protected final String clientId
protected final OAuth2Properties config
protected OAuth2AuthzSession account
protected OAuth2AuthzService service
public final String TAG
public OAuth2AuthzModule(OAuth2Properties config)
public final boolean isAuthorized()
AuthzModuleisAuthorized in interface AuthzModulepublic final boolean hasCredentials()
AuthzModuleAuthzModule.isAuthorized()hasCredentials in interface AuthzModulepublic abstract void requestAccess(android.app.Activity activity,
org.jboss.aerogear.android.core.Callback<String> callback)
AuthzModulerequestAccess in interface AuthzModuleactivity - the calling activity.callback - a callback to be called upon completion of the
authorization action.public final org.jboss.aerogear.android.pipe.module.AuthorizationFields getAuthorizationFields(URI requestUri, String method, byte[] requestBody)
AuthzModulePipe 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 AuthzModulerequestUri - the Request-Line URI.method - the HTTP method being usedrequestBody - the body of the request. This method promises to not
modify the body.public final boolean refreshAccess()
AuthzModulerefreshAccess in interface AuthzModuleprotected boolean hasAccount()
public final org.jboss.aerogear.android.pipe.module.ModuleFields loadModule(URI relativeURI, String httpMethod, byte[] requestBody)
loadModule in interface org.jboss.aerogear.android.pipe.module.PipeModulepublic final boolean handleError(org.jboss.aerogear.android.pipe.http.HttpException exception)
handleError in interface org.jboss.aerogear.android.pipe.module.PipeModulepublic final void deleteAccount()
AuthzModuledeleteAccount in interface AuthzModuleprotected boolean isNullOrEmpty(String testString)
protected void setAccount(OAuth2AuthzSession account)
account - a new account to useprotected void removeAccount()
Copyright © 2017 JBoss by Red Hat. All Rights Reserved.