summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroleksii stepanian <aste@google.com>2015-10-27 17:45:30 -0700
committeroleksii stepanian <aste@google.com>2015-10-27 17:45:30 -0700
commit7721ae67daf0231d57669c43a6e666d8c052c5bb (patch)
tree3679d9bec5d4b7705ef26492241f590e4ba21b99
parent60e68e02a866685aaae8ec05479d30a5dc1598f6 (diff)
downloadvolley-7721ae67daf0231d57669c43a6e666d8c052c5bb.tar.gz
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
-rw-r--r--src/main/java/com/android/volley/toolbox/AndroidAuthenticator.java7
1 files changed, 7 insertions, 0 deletions
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