AccessToken extension to the User interface

no subtypes hierarchy

Initializer
AccessToken(AccessToken unknown)
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
accessTokenshared default Object accessToken()

The Access Token if present parsed as a JsonObject

expiredshared default Boolean expired()

Check if the access token is expired or not.

fetchshared default AccessToken fetch(String resource, Anything(Throwable|OAuth2Response) callback)

Fetches a JSON resource using this Access Token.

Parameters:
  • resource
    • the resource to fetch.
  • callback
    • The callback function returning the results.
fetchshared default AccessToken fetch(HttpMethod method, String resource, Object headers, Buffer payload, Anything(Throwable|OAuth2Response) callback)

Fetches a JSON resource using this Access Token.

Parameters:
  • method
    • the HTTP method to user.
  • resource
    • the resource to fetch.
  • headers
    • extra headers to pass to the request.
  • payload
    • payload to send to the server.
  • callback
    • The callback function returning the results.
idTokenshared default Object idToken()

The Id Token if present parsed as a JsonObject

introspectshared default AccessToken introspect(Anything(Throwable?) callback)

Introspect access token. This is an OAuth2 extension that allow to verify if an access token is still valid.

Parameters:
  • callback
    • The callback function returning the results.
introspectshared default AccessToken introspect(String tokenType, Anything(Throwable?) callback)

Introspect access token. This is an OAuth2 extension that allow to verify if an access token is still valid.

Parameters:
  • tokenType
    • A String containing the type of token to revoke. Should be either “access_token” or “refresh_token”.
  • callback
    • The callback function returning the results.
logoutshared default AccessToken logout(Anything(Throwable?) callback)

Revoke refresh token and calls the logout endpoint. This is a openid-connect extension and might not be available on all providers.

Parameters:
  • callback
    • The callback function returning the results.
opaqueAccessTokenshared default String opaqueAccessToken()
opaqueIdTokenshared default String opaqueIdToken()
opaqueRefreshTokenshared default String opaqueRefreshToken()
refreshshared default AccessToken refresh(Anything(Throwable?) callback)

Refresh the access token

Parameters:
  • callback
    • The callback function returning the results.
refreshTokenshared default Object refreshToken()

The Refresh Token if present parsed as a JsonObject

revokeshared default AccessToken revoke(String token_type, Anything(Throwable?) callback)

Revoke access or refresh token

Parameters:
  • token_type
    • A String containing the type of token to revoke. Should be either “access_token” or “refresh_token”.
  • callback
    • The callback function returning the results.
setTrustJWTshared default AccessToken setTrustJWT(Boolean trust)
tokenTypeshared default String tokenType()
userInfoshared default AccessToken userInfo(Anything(Throwable|Object) callback)

Load the user info as per OIDC spec.

Parameters:
  • callback
    • The callback function returning the results.
Inherited Methods
Methods inherited from: Object
equals
Methods inherited from: User
clearCache, isAuthorised, isAuthorized, principal, setAuthProvider