Home Manual Reference Source Repository
public class | source

OAuth

Indirect Subclass:

ImplicitFlowPopup

OAuth base class

Constructor Summary

Public Constructor
public

constructor(clientId: String, scopes: Array<String>)

Member Summary

Public Members
public get

If the current instance has a valid token

public
public

host: *

public

path: *

public

scopes: *

public

token: *

Method Summary

Public Methods
public abstract

Authenticate

public

forget()

Forget the current session Empty the session token store and forget the api token

public

importToken(token: String, type: String, expires: Date | Number, scopes: Array<string>)

Manually import OAuthToken, usefull for debugging

public

Invalidates the session token

Public Constructors

public constructor(clientId: String, scopes: Array<String>) source

Params:

NameTypeAttributeDescription
clientId String

OAuth client id

scopes Array<String>

A list of required scopes

Public Members

public get authenticated: Boolean: * source

If the current instance has a valid token

Return:

Boolean

If a valid token is available

public clientId: * source

public host: * source

public path: * source

public scopes: * source

public token: * source

Public Methods

public abstract authenticate(): Promise<OAuthToken> source

Authenticate

Return:

Promise<OAuthToken>

Authentication token

Throw:

OAuthError

public forget() source

Forget the current session Empty the session token store and forget the api token

public importToken(token: String, type: String, expires: Date | Number, scopes: Array<string>) source

Manually import OAuthToken, usefull for debugging

Params:

NameTypeAttributeDescription
token String

OAuth token

type String
  • optional
  • default: Bearer

token type

expires Date | Number
  • optional
  • default: 5 days

expire time in seconds or Date

scopes Array<string>
  • optional
  • default: []

Any scopes

public logout(): CancelablePromise source

Invalidates the session token

Throw:

OAuthError

If de-authentication fails

ApiError

If the api returns errors