public class

AndroidAuthenticator

extends Object
implements Authenticator
java.lang.Object
   ↳ com.android.volley.toolbox.AndroidAuthenticator

Class Overview

An Authenticator that uses AccountManager to get auth tokens of a specified type for a specified account.

Summary

Public Constructors
AndroidAuthenticator(Context context, Account account, String authTokenType)
Creates a new authenticator.
AndroidAuthenticator(Context context, Account account, String authTokenType, boolean notifyAuthFailure)
Creates a new authenticator.
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.volley.toolbox.Authenticator

Public Constructors

public AndroidAuthenticator (Context context, Account account, String authTokenType)

Creates a new authenticator.

Parameters
context Context for accessing AccountManager
account Account to authenticate as
authTokenType Auth token type passed to AccountManager

public AndroidAuthenticator (Context context, Account account, String authTokenType, boolean notifyAuthFailure)

Creates a new authenticator.

Parameters
context Context for accessing AccountManager
account Account to authenticate as
authTokenType Auth token type passed to AccountManager
notifyAuthFailure Whether to raise a notification upon auth failure

Public Methods

public Account getAccount ()

Returns the Account being used by this authenticator.

public String getAuthToken ()

Synchronously retrieves an auth token.

public String getAuthTokenType ()

Returns the Auth Token Type used by this authenticator.

public void invalidateAuthToken (String authToken)

Invalidates the provided auth token.