public class AndroidAuthenticator extends Object implements Authenticator
AccountManager
to get auth
tokens of a specified type for a specified account.Constructor and Description |
---|
AndroidAuthenticator(Context context,
Account account,
String authTokenType)
Creates a new authenticator.
|
AndroidAuthenticator(Context context,
Account account,
String authTokenType,
boolean notifyAuthFailure)
Creates a new authenticator.
|
Modifier and Type | Method and Description |
---|---|
Account |
getAccount()
Returns the Account being used by this authenticator.
|
String |
getAuthToken()
Synchronously retrieves an auth token.
|
String |
getAuthTokenType()
Returns the Auth Token Type used by this authenticator.
|
void |
invalidateAuthToken(String authToken)
Invalidates the provided auth token.
|
public AndroidAuthenticator(Context context, Account account, String authTokenType)
context
- Context for accessing AccountManageraccount
- Account to authenticate asauthTokenType
- Auth token type passed to AccountManagerpublic AndroidAuthenticator(Context context, Account account, 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 Account getAccount()
public String getAuthTokenType()
public String getAuthToken() throws AuthFailureError
Authenticator
getAuthToken
in interface Authenticator
AuthFailureError
- If authentication did not succeedpublic void invalidateAuthToken(String authToken)
Authenticator
invalidateAuthToken
in interface Authenticator