public static class OAuth2Util.AuthSession
extends java.lang.Object
Constructor and Description |
---|
AuthSession(java.util.Map<java.lang.String,java.lang.String> baseHeaders,
java.lang.String token,
java.lang.String tokenType,
java.lang.String credential,
java.lang.String scope) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
credential() |
static OAuth2Util.AuthSession |
empty()
A new
OAuth2Util.AuthSession with empty headers. |
java.lang.Long |
expiresAtMillis() |
static OAuth2Util.AuthSession |
fromAccessToken(RESTClient client,
java.util.concurrent.ScheduledExecutorService executor,
java.lang.String token,
java.lang.Long defaultExpiresAtMillis,
OAuth2Util.AuthSession parent) |
static OAuth2Util.AuthSession |
fromCredential(RESTClient client,
java.util.concurrent.ScheduledExecutorService executor,
java.lang.String credential,
OAuth2Util.AuthSession parent) |
static OAuth2Util.AuthSession |
fromTokenExchange(RESTClient client,
java.util.concurrent.ScheduledExecutorService executor,
java.lang.String token,
java.lang.String tokenType,
OAuth2Util.AuthSession parent) |
static OAuth2Util.AuthSession |
fromTokenResponse(RESTClient client,
java.util.concurrent.ScheduledExecutorService executor,
OAuthTokenResponse response,
long startTimeMillis,
OAuth2Util.AuthSession parent) |
java.util.Map<java.lang.String,java.lang.String> |
headers() |
Pair<java.lang.Integer,java.util.concurrent.TimeUnit> |
refresh(RESTClient client)
Attempt to refresh the session token using the token exchange flow.
|
java.lang.String |
scope() |
void |
stopRefreshing() |
java.lang.String |
token() |
java.lang.String |
tokenType() |
public AuthSession(java.util.Map<java.lang.String,java.lang.String> baseHeaders, java.lang.String token, java.lang.String tokenType, java.lang.String credential, java.lang.String scope)
public java.util.Map<java.lang.String,java.lang.String> headers()
public java.lang.String token()
public java.lang.String tokenType()
public java.lang.Long expiresAtMillis()
public java.lang.String scope()
public void stopRefreshing()
public java.lang.String credential()
public static OAuth2Util.AuthSession empty()
OAuth2Util.AuthSession
with empty headers.OAuth2Util.AuthSession
with empty headers.public Pair<java.lang.Integer,java.util.concurrent.TimeUnit> refresh(RESTClient client)
client
- a RESTClientpublic static OAuth2Util.AuthSession fromAccessToken(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String token, java.lang.Long defaultExpiresAtMillis, OAuth2Util.AuthSession parent)
public static OAuth2Util.AuthSession fromCredential(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String credential, OAuth2Util.AuthSession parent)
public static OAuth2Util.AuthSession fromTokenResponse(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, OAuthTokenResponse response, long startTimeMillis, OAuth2Util.AuthSession parent)
public static OAuth2Util.AuthSession fromTokenExchange(RESTClient client, java.util.concurrent.ScheduledExecutorService executor, java.lang.String token, java.lang.String tokenType, OAuth2Util.AuthSession parent)