Home Manual Reference Source Repository
public class | source

PasswordFlow

Extends:

OAuth → PasswordFlow

Password authentication flow

Constructor Summary

Public Constructor
public

constructor(clientId: string, secret: string, username: string, password: string, scopes: Array<string>)

Member Summary

Public Members
public get

Get the password

public set

password(value: String)

Set the password

public get

path: String: *

OAuth path

public set

path(value: String)

OAuth path

public get

it's a secret :o (client secret)

public set

secret(value: String)

Set client secret

public

token: *

public get

Get the username for authentication

public set

username(value: String)

Get the username for authentication

Method Summary

Public Methods
public

Authenticate

Inherited Summary

From class OAuth
public get

If the current instance has a valid token

public
public

host: *

public

path: *

public

scopes: *

public

token: *

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, secret: string, username: string, password: string, scopes: Array<string>) source

Override:

OAuth#constructor

Params:

NameTypeAttributeDescription
clientId string

OAuth client id

secret string

OAuth secret

username string

Valid username (email)

password string

Valid password

scopes Array<string>

A list of required scopes

Public Members

public get password: String: * source

Get the password

Return:

String

Password

public set password(value: String) source

Set the password

public get path: String: * source

OAuth path

Override:

OAuth#path

Return:

String

OAuth path

public set path(value: String) source

OAuth path

Override:

OAuth#path

public get secret: String: * source

it's a secret :o (client secret)

Return:

String

secret

public set secret(value: String) source

Set client secret

public token: * source

Override:

OAuth#token

public get username: String: * source

Get the username for authentication

Return:

String

Username (email)

public set username(value: String) source

Get the username for authentication

Public Methods

public authenticate(): CancelablePromise<OAuthToken> source

Authenticate

Override:

OAuth#authenticate

Return:

CancelablePromise<OAuthToken>

Response token

Throw:

OAuthError