Skip to main content

@auvious/common / OAuth2Token

Class: OAuth2Token

oauth2 token class for auvious' services.

Implements​

Table of contents​

Constructors​

Properties​

Accessors​

Methods​

Constructors​

constructor​

• new OAuth2Token(client, json): OAuth2Token

Parameters​

NameType
clientOAuth2Client
jsonany

Returns​

OAuth2Token

Properties​

_client​

• Private _client: OAuth2Client


accessToken​

• accessToken: string

Implementation of​

IOAuth2Token.accessToken


createdAt​

• createdAt: Date

Implementation of​

IOAuth2Token.createdAt


expiresAt​

• expiresAt: Date

Implementation of​

IOAuth2Token.expiresAt


expiresIn​

• expiresIn: number

Implementation of​

IOAuth2Token.expiresIn


isGuest​

• isGuest: boolean

Implementation of​

IOAuth2Token.isGuest


refreshToken​

• refreshToken: string

Implementation of​

IOAuth2Token.refreshToken


scope​

• scope: string

Implementation of​

IOAuth2Token.scope


type​

• type: string

Implementation of​

IOAuth2Token.type


userId​

• userId: string

Implementation of​

IOAuth2Token.userId

Accessors​

bearer​

• get bearer(): string

Returns​

string

Implementation of​

IOAuth2Token.bearer


isExpired​

• get isExpired(): boolean

Returns​

boolean

Implementation of​

IOAuth2Token.isExpired

Methods​

getValueFromJwtToken​

▸ getValueFromJwtToken(token, field): any

Parameters​

NameType
tokenstring
fieldstring

Returns​

any


importJSON​

▸ importJSON(json): void

Parameters​

NameType
jsonany

Returns​

void

Implementation of​

IOAuth2Token.importJSON


refresh​

▸ refresh(): Promise<IOAuth2Token>

Returns​

Promise<IOAuth2Token>

Implementation of​

IOAuth2Token.refresh


toJSON​

▸ toJSON(): any

Returns​

any

Implementation of​

IOAuth2Token.toJSON


toJSONStringified​

▸ toJSONStringified(): string

Returns​

string

Implementation of​

IOAuth2Token.toJSONStringified