Class: AccessToken

vertx-auth-oauth2-js/access_token~ AccessToken

new AccessToken()

AccessToken extension to the User interface
Source:

Methods

accessToken() → {Object}

The Access Token if present parsed as a JsonObject
Source:
Returns:
JSON
Type
Object

expired() → {boolean}

Check if the access token is expired or not.
Source:
Returns:
Type
boolean

fetch(method, resource, headers, payload, callback) → {AccessToken}

Fetches a JSON resource using this Access Token.
Parameters:
Name Type Description
method Object the HTTP method to user.
resource string the resource to fetch.
headers Object extra headers to pass to the request.
payload Buffer payload to send to the server.
callback function The callback function returning the results.
Source:
Returns:
Type
AccessToken

idToken() → {Object}

The Id Token if present parsed as a JsonObject
Source:
Returns:
JSON
Type
Object

introspect(tokenType, callback) → {AccessToken}

Introspect access token. This is an OAuth2 extension that allow to verify if an access token is still valid.
Parameters:
Name Type Description
tokenType string A String containing the type of token to revoke. Should be either "access_token" or "refresh_token".
callback function The callback function returning the results.
Source:
Returns:
Type
AccessToken

logout(callback) → {AccessToken}

Revoke refresh token and calls the logout endpoint. This is a openid-connect extension and might not be available on all providers.
Parameters:
Name Type Description
callback function The callback function returning the results.
Source:
Returns:
Type
AccessToken

opaqueAccessToken() → {string}

The RAW String if available for the Access Token
Source:
Returns:
String
Type
string

opaqueIdToken() → {string}

The RAW String if available for the Id Token
Source:
Returns:
String
Type
string

opaqueRefreshToken() → {string}

The RAW String if available for the Refresh Token
Source:
Returns:
String
Type
string

refresh(callback) → {AccessToken}

Refresh the access token
Parameters:
Name Type Description
callback function The callback function returning the results.
Source:
Returns:
Type
AccessToken

revoke(token_type, callback) → {AccessToken}

Revoke access or refresh token
Parameters:
Name Type Description
token_type string A String containing the type of token to revoke. Should be either "access_token" or "refresh_token".
callback function The callback function returning the results.
Source:
Returns:
Type
AccessToken

setTrustJWT(trust) → {AccessToken}

Parameters:
Name Type Description
trust boolean
Source:
Returns:
Type
AccessToken

tokenType() → {string}

Source:
Returns:
Type
string

userInfo(callback) → {AccessToken}

Load the user info as per OIDC spec.
Parameters:
Name Type Description
callback function The callback function returning the results.
Source:
Returns:
Type
AccessToken