public class AndroidAuthenticator extends java.lang.Object implements Authenticator
AccountManager to get auth
tokens of a specified type for a specified account.| Constructor and Description |
|---|
AndroidAuthenticator(android.content.Context context,
android.accounts.Account account,
java.lang.String authTokenType)
Creates a new authenticator.
|
AndroidAuthenticator(android.content.Context context,
android.accounts.Account account,
java.lang.String authTokenType,
boolean notifyAuthFailure)
Creates a new authenticator.
|
| Modifier and Type | Method and Description |
|---|---|
android.accounts.Account |
getAccount()
Returns the Account being used by this authenticator.
|
java.lang.String |
getAuthToken()
Synchronously retrieves an auth token.
|
void |
invalidateAuthToken(java.lang.String authToken)
Invalidates the provided auth token.
|
public AndroidAuthenticator(android.content.Context context,
android.accounts.Account account,
java.lang.String authTokenType)
context - Context for accessing AccountManageraccount - Account to authenticate asauthTokenType - Auth token type passed to AccountManagerpublic AndroidAuthenticator(android.content.Context context,
android.accounts.Account account,
java.lang.String authTokenType,
boolean notifyAuthFailure)
context - Context for accessing AccountManageraccount - Account to authenticate asauthTokenType - Auth token type passed to AccountManagernotifyAuthFailure - Whether to raise a notification upon auth failurepublic android.accounts.Account getAccount()
public java.lang.String getAuthToken()
throws AuthFailureError
AuthenticatorgetAuthToken in interface AuthenticatorAuthFailureError - If authentication did not succeedpublic void invalidateAuthToken(java.lang.String authToken)
AuthenticatorinvalidateAuthToken in interface Authenticator