Home Manual Reference Source Repository
public class | source

ImplicitFlow

Extends:

OAuth → ImplicitFlow

Direct Subclass:

ImplicitFlowPopup

Implicit OAuth flow using redirection

Constructor Summary

Public Constructor
public

constructor(clientId: String, callbackUrl: String, scopes: Array<String>, useState: Boolean)

Implicit authentication flow

Member Summary

Public Members
public
public
public

token: *

public

Method Summary

Public Methods
public
Protected Methods
protected

Test if the anchor contains an OAuth error

protected

Test if the anchor contains an OAuth response

protected

Builds the url for redirection

protected

Remove OAuth related anchor parameters

protected

Builds an object containing all the anchor parameters

protected

Get and return the error in the anchor

protected

Fetch OAuth anchor params

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, callbackUrl: String, scopes: Array<String>, useState: Boolean) source

Implicit authentication flow

Override:

OAuth#constructor

Params:

NameTypeAttributeDescription
clientId String

OAuth client id

callbackUrl String

callbackUrl for obtaining the token. This should be a page with this script on it. If left empty the current url will be used.

scopes Array<String>

A list of required scopes

useState Boolean

use state verification

Public Members

public callbackUrl: * source

public path: string source

Override:

OAuth#path

public token: * source

Override:

OAuth#token

public useState: * source

Public Methods

public authenticate(): * source

Authenticate

Override:

OAuth#authenticate

Return:

*

Protected Methods

protected _anchorContainsError(): Boolean source

Test if the anchor contains an OAuth error

Return:

Boolean

If anchor tested positive for containing an OAuth error

protected _anchorContainsOAuthResponse(): Boolean source

Test if the anchor contains an OAuth response

Return:

Boolean

If anchor tested positive for containing an OAuth response

protected _buildRedirectUrl(): String source

Builds the url for redirection

Return:

String

Redirect url

protected _cleanAnchorParams() source

Remove OAuth related anchor parameters

protected _getAnchorParams(query: String): Object<String, String> source

Builds an object containing all the anchor parameters

Params:

NameTypeAttributeDescription
query String

Url hash

Return:

Object<String, String>

Anchor parameters

protected _getError(): OAuthError source

Get and return the error in the anchor

Return:

OAuthError

OAuthError object

protected _getOAuthAnchorParams(query: Object<String, String>): Object<String, String> source

Fetch OAuth anchor params

Params:

NameTypeAttributeDescription
query Object<String, String>

Optional override for the query to analyse, defaults to ImplicitFlow#_getAnchorParams

Return:

Object<String, String>

List of OAuth anchor parameters