Package org.refcodes.net
Interface OauthToken
-
- All Superinterfaces:
org.refcodes.mixin.Disposable
,org.refcodes.mixin.Disposable.Disposedable
,org.refcodes.mixin.DisposedAccessor
,org.refcodes.mixin.ValidAccessor
- All Known Implementing Classes:
OauthTokenImpl
public interface OauthToken extends org.refcodes.mixin.ValidAccessor, org.refcodes.mixin.Disposable.Disposedable
An OAuth-Token contains all relevant information to access a protected resource and refresh the the access token. "If the request for an access token is valid, the authorization server needs to generate an access token (and optional refresh token) and return these to the client, typically along with some additional properties about the authorization."HTTP/1.1 200 OK Content-Type: application/json Cache-Control: no-store Pragma: no-cache { "access_token":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3", "token_type":"bearer", "expires_in":3600, "refresh_token":"IwOGYzYTlmM2YxOTQ5MGE3YmNmMDFkNTVk", "scope":"create" }
See "https://www.oauth.com/oauth2-servers/access-tokens/access-token-response"
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.Disposable
org.refcodes.mixin.Disposable.Disposedable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getAccessToken()
Returns the access token.java.lang.Integer
getExpiresIn()
Returns the time in seconds till the access token (getAccessToken()
) expires.java.lang.String
getNotBeforePolicy()
Returns the not-before-policy.java.lang.Integer
getRefreshExpiresIn()
Returns the time in seconds till the refresh token (getRefreshToken()
) expires.java.lang.String
getRefreshToken()
Returns the refresh token.java.lang.String
getScope()
Returns the OAuth scope.java.lang.String
getSessionState()
Returns the session state.java.lang.String
getTokenType()
Returns the token type.boolean
isValid()
Returns alwaystrue
if no "expires in" time (getExpiresIn()
) has been set!
-
-
-
Method Detail
-
getAccessToken
java.lang.String getAccessToken()
Returns the access token. "The access token string as issued by the authorization server." See "https://www.oauth.com/oauth2-servers/access-tokens/access-token-response"- Returns:
- the access token.
-
getRefreshToken
java.lang.String getRefreshToken()
Returns the refresh token. "The access token string as issued by the authorization server." See "https://www.oauth.com/oauth2-servers/access-tokens/access-token-response"- Returns:
- the refresh token.
-
getScope
java.lang.String getScope()
Returns the OAuth scope. "If the scope the user granted is identical to the scope the app requested, this parameter is optional. If the granted scope is different from the requested scope, such as if the user modified the scope, then this parameter is required." See "https://www.oauth.com/oauth2-servers/access-tokens/access-token-response"- Returns:
- the OAuth scope.
-
getNotBeforePolicy
java.lang.String getNotBeforePolicy()
Returns the not-before-policy.- Returns:
- the not-before-policy.
-
getSessionState
java.lang.String getSessionState()
Returns the session state.- Returns:
- the session state.
-
getTokenType
java.lang.String getTokenType()
Returns the token type. "The type of token this is, typically just the string bearer" See "https://www.oauth.com/oauth2-servers/access-tokens/access-token-response"- Returns:
- the token type.
-
getExpiresIn
java.lang.Integer getExpiresIn()
Returns the time in seconds till the access token (getAccessToken()
) expires. "If the access token expires, the server should reply with the duration of time the access token is granted for." See "https://www.oauth.com/oauth2-servers/access-tokens/access-token-response"- Returns:
- the Expires-In time in seconds
-
getRefreshExpiresIn
java.lang.Integer getRefreshExpiresIn()
Returns the time in seconds till the refresh token (getRefreshToken()
) expires.- Returns:
- the Expires-In time in seconds
-
isValid
boolean isValid()
Returns alwaystrue
if no "expires in" time (getExpiresIn()
) has been set!- Specified by:
isValid
in interfaceorg.refcodes.mixin.ValidAccessor
-
-