From 7721ae67daf0231d57669c43a6e666d8c052c5bb Mon Sep 17 00:00:00 2001 From: oleksii stepanian Date: Tue, 27 Oct 2015 17:45:30 -0700 Subject: Add API to get Auth Token Type used by authenticator. When using different auth protocols e.g. ClientLogin and OAuth2 it is important to know the type of the token in order to construct "Authorization" header. Currently we have to store auth token vaue/auth token type association elsewhere which makes it a subject for errors. Change-Id: I3b8c05672f5394ad806f257c9f6bb378ebf990d7 --- src/main/java/com/android/volley/toolbox/AndroidAuthenticator.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/main/java/com/android/volley/toolbox/AndroidAuthenticator.java b/src/main/java/com/android/volley/toolbox/AndroidAuthenticator.java index bdf7091..18f8597 100644 --- a/src/main/java/com/android/volley/toolbox/AndroidAuthenticator.java +++ b/src/main/java/com/android/volley/toolbox/AndroidAuthenticator.java @@ -73,6 +73,13 @@ public class AndroidAuthenticator implements Authenticator { return mAccount; } + /** + * Returns the Auth Token Type used by this authenticator. + */ + public String getAuthTokenType() { + return mAuthTokenType; + } + // TODO: Figure out what to do about notifyAuthFailure @SuppressWarnings("deprecation") @Override -- cgit v1.2.3