org.refcodes.mixin.Disposable
, org.refcodes.mixin.Disposable.Disposedable
, org.refcodes.mixin.DisposedAccessor
, org.refcodes.mixin.ValidAccessor
, org.refcodes.web.OauthToken
public class OauthTokenHandler
extends org.refcodes.web.OauthTokenImpl
implements org.refcodes.web.OauthToken
OauthToken
. In case a refresh
token (as of OauthTokenImpl.getRefreshToken()
and has been provided, then the
access token (as of OauthTokenImpl.getAccessToken()
is refreshed within the
"expires in" time (as of OauthTokenImpl.getExpiresIn()
. The refresh daemon
terminates and this instance is disposed when the provided
HttpRestClient
's Closable.close()
method is called or
the dispose()
method is invoked.org.refcodes.mixin.Disposable.Disposedable
Constructor | Description |
---|---|
OauthTokenHandler(String aUrl,
String aAccessToken,
String aRefreshToken,
String aTokenType,
Integer aExpiresIn,
String aScope) |
Constructs an instance of the
OauthTokenHandler with the given
parameters. |
OauthTokenHandler(String aUrl,
String aClientId,
String aClientSecret,
String aUserName,
String aUserPassword) |
Constructs an instance of the
OauthTokenHandler with the given
parameters by using the user's name and password for a "password" grant
type authentication to retrieve a OauthToken . |
OauthTokenHandler(String aUrl,
HttpRestClient aHttpRestClient,
String aAccessToken,
String aRefreshToken,
String aTokenType,
Integer aExpiresIn,
String aScope) |
Constructs an instance of the
OauthTokenHandler with the given
parameters. |
OauthTokenHandler(String aUrl,
HttpRestClient aHttpRestClient,
String aClientId,
String aClientSecret,
String aUserName,
String aUserPassword) |
Constructs an instance of the
OauthTokenHandler with the given
parameters by using the user's name and password for a "password" grant
type authentication to retrieve a OauthToken . |
OauthTokenHandler(String aUrl,
HttpRestClient aHttpRestClient,
org.refcodes.web.OauthToken aOauthToken) |
Constructs an instance of the
OauthTokenHandler with the given
parameters. |
OauthTokenHandler(String aUrl,
org.refcodes.web.OauthToken aOauthToken) |
Constructs an instance of the
OauthTokenHandler with the given
parameters. |
OauthTokenHandler(org.refcodes.web.Url aUrl,
String aAccessToken,
String aRefreshToken,
String aTokenType,
Integer aExpiresIn,
String aScope) |
Constructs an instance of the
OauthTokenHandler with the given
parameters. |
OauthTokenHandler(org.refcodes.web.Url aUrl,
String aClientId,
String aClientSecret,
String aUserName,
String aUserPassword) |
Constructs an instance of the
OauthTokenHandler with the given
parameters by using the user's name and password for a "password" grant
type authentication to retrieve a OauthToken . |
OauthTokenHandler(org.refcodes.web.Url aUrl,
HttpRestClient aHttpRestClient,
String aAccessToken,
String aRefreshToken,
String aTokenType,
Integer aExpiresIn,
String aScope) |
Constructs an instance of the
OauthTokenHandler with the given
parameters. |
OauthTokenHandler(org.refcodes.web.Url aUrl,
HttpRestClient aHttpRestClient,
String aClientId,
String aClientSecret,
String aUserName,
String aUserPassword) |
Constructs an instance of the
OauthTokenHandler with the given
parameters by using the user's name and password for a "password" grant
type authentication to retrieve a OauthToken . |
OauthTokenHandler(org.refcodes.web.Url aUrl,
HttpRestClient aHttpRestClient,
org.refcodes.web.HttpBodyMap aOauthToken) |
Constructs an instance of the
OauthTokenHandler with the given
parameters. |
OauthTokenHandler(org.refcodes.web.Url aUrl,
HttpRestClient aHttpRestClient,
org.refcodes.web.OauthToken aOauthToken) |
Constructs an instance of the
OauthTokenHandler with the given
parameters. |
OauthTokenHandler(org.refcodes.web.Url aUrl,
org.refcodes.web.HttpBodyMap aOauthToken) |
Constructs an instance of the
OauthTokenHandler with the given
parameters. |
OauthTokenHandler(org.refcodes.web.Url aUrl,
org.refcodes.web.OauthToken aOauthToken) |
Constructs an instance of the
OauthTokenHandler with the given
parameters. |
Modifier and Type | Method | Description |
---|---|---|
void |
dispose() |
getAccessToken, getExpiresIn, getNotBeforePolicy, getRefreshExpiresIn, getRefreshToken, getScope, getSessionState, getTokenType, isValid
public OauthTokenHandler(org.refcodes.web.Url aUrl, String aClientId, String aClientSecret, String aUserName, String aUserPassword) throws org.refcodes.web.HttpStatusException, MalformedURLException
OauthTokenHandler
with the given
parameters by using the user's name and password for a "password" grant
type authentication to retrieve a OauthToken
.aUrl
- The Url
to be used when refreshing the access token.aUserName
- The user's name for "password" grant type.aUserPassword
- The user's password for "password" grant type.aClientId
- The client's TID for "password" grant type.aClientSecret
- The client's secret for "password" grant type.MalformedURLException
- thrown in case of a malformed URL.org.refcodes.web.HttpStatusException
- thrown in case a HTTP response was of an
erroneous status.public OauthTokenHandler(org.refcodes.web.Url aUrl, HttpRestClient aHttpRestClient, String aClientId, String aClientSecret, String aUserName, String aUserPassword) throws org.refcodes.web.HttpStatusException, MalformedURLException
OauthTokenHandler
with the given
parameters by using the user's name and password for a "password" grant
type authentication to retrieve a OauthToken
.aUrl
- The Url
to be used when refreshing the access token.aHttpRestClient
- The HttpRestClient
to use when refreshing
the token.aUserName
- The user's name for "password" grant type.aUserPassword
- The user's password for "password" grant type.aClientId
- The client's TID for "password" grant type.aClientSecret
- The client's secret for "password" grant type.MalformedURLException
- thrown in case of a malformed URL.org.refcodes.web.HttpStatusException
- thrown in case a HTTP response was of an
erroneous status.public OauthTokenHandler(String aUrl, String aClientId, String aClientSecret, String aUserName, String aUserPassword) throws org.refcodes.web.HttpStatusException, MalformedURLException
OauthTokenHandler
with the given
parameters by using the user's name and password for a "password" grant
type authentication to retrieve a OauthToken
.aUrl
- The URL to be used when refreshing the access token.aUserName
- The user's name for "password" grant type.aUserPassword
- The user's password for "password" grant type.aClientId
- The client's TID for "password" grant type.aClientSecret
- The client's secret for "password" grant type.MalformedURLException
- thrown in case of a malformed URL.org.refcodes.web.HttpStatusException
- thrown in case a HTTP response was of an
erroneous status.public OauthTokenHandler(String aUrl, HttpRestClient aHttpRestClient, String aClientId, String aClientSecret, String aUserName, String aUserPassword) throws org.refcodes.web.HttpStatusException, MalformedURLException
OauthTokenHandler
with the given
parameters by using the user's name and password for a "password" grant
type authentication to retrieve a OauthToken
.aUrl
- The URL to be used when refreshing the access token.aHttpRestClient
- The HttpRestClient
to use when refreshing
the token.aUserName
- The user's name for "password" grant type.aUserPassword
- The user's password for "password" grant type.aClientId
- The client's TID for "password" grant type.aClientSecret
- The client's secret for "password" grant type.MalformedURLException
- thrown in case of a malformed URL.org.refcodes.web.HttpStatusException
- thrown in case a HTTP response was of an
erroneous status.public OauthTokenHandler(String aUrl, String aAccessToken, String aRefreshToken, String aTokenType, Integer aExpiresIn, String aScope)
OauthTokenHandler
with the given
parameters. For the refresh token parameters, please refer to
"https://www.oauth.com/oauth2-servers/access-tokens/refreshing-access-tokens".aUrl
- The Url
to be used when refreshing the access token.aAccessToken
- The access token to be stored (as of
OauthTokenImpl.getAccessToken()
).aRefreshToken
- The refresh token to be used (as of
OauthTokenImpl.getRefreshToken()
).aTokenType
- The token type to be stored (as of
OauthTokenImpl.getTokenType()
).aExpiresIn
- The "expires in" time to be stored (as of
OauthTokenImpl.getExpiresIn()
).aScope
- The scope to be stored (as of OauthTokenImpl.getScope()
).public OauthTokenHandler(org.refcodes.web.Url aUrl, String aAccessToken, String aRefreshToken, String aTokenType, Integer aExpiresIn, String aScope)
OauthTokenHandler
with the given
parameters.aUrl
- The Url
to be used when refreshing the access token.aAccessToken
- The access token to be stored (as of
OauthTokenImpl.getAccessToken()
).aRefreshToken
- The refresh token to be used (as of
OauthTokenImpl.getRefreshToken()
).aTokenType
- The token type to be stored (as of
OauthTokenImpl.getTokenType()
).aExpiresIn
- The "expires in" time to be stored (as of
OauthTokenImpl.getExpiresIn()
).aScope
- The scope to be stored (as of OauthTokenImpl.getScope()
).public OauthTokenHandler(org.refcodes.web.Url aUrl, org.refcodes.web.HttpBodyMap aOauthToken)
OauthTokenHandler
with the given
parameters.aUrl
- The Url
to be used when refreshing the access token.aOauthToken
- The HttpBodyMap
containing the OAuth token
with the required information.public OauthTokenHandler(org.refcodes.web.Url aUrl, org.refcodes.web.OauthToken aOauthToken)
OauthTokenHandler
with the given
parameters.aUrl
- The Url
to be used when refreshing the access token.aOauthToken
- The OauthToken
containing the required
information.public OauthTokenHandler(String aUrl, org.refcodes.web.OauthToken aOauthToken)
OauthTokenHandler
with the given
parameters. For the refresh token parameters, please refer to
"https://www.oauth.com/oauth2-servers/access-tokens/refreshing-access-tokens".aUrl
- The Url
to be used when refreshing the access token.aOauthToken
- The OauthToken
containing the required
information.public OauthTokenHandler(org.refcodes.web.Url aUrl, HttpRestClient aHttpRestClient, String aAccessToken, String aRefreshToken, String aTokenType, Integer aExpiresIn, String aScope)
OauthTokenHandler
with the given
parameters.aUrl
- The Url
to be used when refreshing the access token.aHttpRestClient
- The HttpRestClient
to use when refreshing
the token.aAccessToken
- The access token to be stored (as of
OauthTokenImpl.getAccessToken()
).aRefreshToken
- The refresh token to be used (as of
OauthTokenImpl.getRefreshToken()
).aTokenType
- The token type to be stored (as of
OauthTokenImpl.getTokenType()
).aExpiresIn
- The "expires in" time to be stored (as of
OauthTokenImpl.getExpiresIn()
).aScope
- The scope to be stored (as of OauthTokenImpl.getScope()
).public OauthTokenHandler(org.refcodes.web.Url aUrl, HttpRestClient aHttpRestClient, org.refcodes.web.HttpBodyMap aOauthToken)
OauthTokenHandler
with the given
parameters.aUrl
- The Url
to be used when refreshing the access token.aHttpRestClient
- The HttpRestClient
to use when refreshing
the token.aOauthToken
- The HttpBodyMap
containing the OAuth token
with the required information.public OauthTokenHandler(String aUrl, HttpRestClient aHttpRestClient, org.refcodes.web.OauthToken aOauthToken)
OauthTokenHandler
with the given
parameters.aUrl
- The URL to be used when refreshing the access token.aHttpRestClient
- The HttpRestClient
to use when refreshing
the token.aOauthToken
- The OauthToken
containing the required
information.public OauthTokenHandler(org.refcodes.web.Url aUrl, HttpRestClient aHttpRestClient, org.refcodes.web.OauthToken aOauthToken)
OauthTokenHandler
with the given
parameters.aUrl
- The Url
to be used when refreshing the access token.aHttpRestClient
- The HttpRestClient
to use when refreshing
the token.aOauthToken
- The OauthToken
containing the required
information.public OauthTokenHandler(String aUrl, HttpRestClient aHttpRestClient, String aAccessToken, String aRefreshToken, String aTokenType, Integer aExpiresIn, String aScope)
OauthTokenHandler
with the given
parameters. For the refresh token parameters, please refer to
"https://www.oauth.com/oauth2-servers/access-tokens/refreshing-access-tokens".aUrl
- The Url
to be used when refreshing the access token.aHttpRestClient
- The HttpRestClient
to use when refreshing
the token.aAccessToken
- The access token to be stored (as of
OauthTokenImpl.getAccessToken()
).aRefreshToken
- The refresh token to be used (as of
OauthTokenImpl.getRefreshToken()
).aTokenType
- The token type to be stored (as of
OauthTokenImpl.getTokenType()
).aExpiresIn
- The "expires in" time to be stored (as of
OauthTokenImpl.getExpiresIn()
).aScope
- The scope to be stored (as of OauthTokenImpl.getScope()
).Copyright © 2021. All rights reserved.