# Class: AccessToken

## vertx-auth-oauth2-js/access_token~ AccessToken

#### new AccessToken()

AccessToken extension to the User interface

Source:
  - vertx-auth-oauth2-js/access_token.js, line 31

### Methods

#### clearCache() → {User}

Source:
  - vertx-auth-oauth2-js/access_token.js, line 64

##### Returns:

Type
  User

#### expired() → {boolean}

Check if the access token is expired or not.

Source:
  - vertx-auth-oauth2-js/access_token.js, line 104

##### Returns:

Type
  boolean

#### isAuthorised(arg0, arg1) → {User}

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg0` | string |
`arg1` | function |

Source:
  - vertx-auth-oauth2-js/access_token.js, line 44

##### Returns:

Type
  User

#### 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:
  - vertx-auth-oauth2-js/access_token.js, line 162

##### Returns:

Type
  AccessToken

#### principal() → {Object}

Source:
  - vertx-auth-oauth2-js/access_token.js, line 78

##### Returns:

Type
  Object

#### refresh(callback) → {AccessToken}

Refresh the access token

##### Parameters:

Name | Type | Description
--- | --- | ---
`callback` | function | The callback function returning the results.

Source:
  - vertx-auth-oauth2-js/access_token.js, line 118

##### 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:
  - vertx-auth-oauth2-js/access_token.js, line 140

##### Returns:

Type
  AccessToken

#### setAuthProvider(arg0)

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg0` | AuthProvider |

Source:
  - vertx-auth-oauth2-js/access_token.js, line 90