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
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.DisposedAccessor

        org.refcodes.mixin.DisposedAccessor.DisposedMutator, org.refcodes.mixin.DisposedAccessor.DisposedProperty
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.ValidAccessor

        org.refcodes.mixin.ValidAccessor.ValidBuilder<B extends org.refcodes.mixin.ValidAccessor.ValidBuilder<B>>, org.refcodes.mixin.ValidAccessor.ValidMutator, org.refcodes.mixin.ValidAccessor.ValidProperty
    • Method Detail

      • getAccessToken

        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

        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

        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

        String getNotBeforePolicy​()
        Returns the not-before-policy.
        Returns:
        the not-before-policy.
      • getSessionState

        String getSessionState​()
        Returns the session state.
        Returns:
        the session state.
      • getTokenType

        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

        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

        Integer getRefreshExpiresIn​()
        Returns the time in seconds till the refresh token (getRefreshToken()) expires.
        Returns:
        the Expires-In time in seconds
      • isValid

        boolean isValid​()
        Returns always true if no "expires in" time (getExpiresIn()) has been set!
        Specified by:
        isValid in interface org.refcodes.mixin.ValidAccessor