Edit

Share via


ProtocolUtils class

Class which provides helpers for OAuth 2.0 protocol specific values

Methods

generateLibraryState(ICrypto, Record<string, string>)

Generates the state value used by the common library.

parseRequestState(ICrypto, string)

Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.

setRequestState(ICrypto, string, Record<string, string>)

Appends user state with random guid, or returns random guid.

Method Details

generateLibraryState(ICrypto, Record<string, string>)

Generates the state value used by the common library.

static function generateLibraryState(cryptoObj: ICrypto, meta?: Record<string, string>): string

Parameters

cryptoObj
ICrypto
meta

Record<string, string>

Returns

string

parseRequestState(ICrypto, string)

Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.

static function parseRequestState(cryptoObj: ICrypto, state: string): RequestStateObject

Parameters

cryptoObj
ICrypto
state

string

Returns

setRequestState(ICrypto, string, Record<string, string>)

Appends user state with random guid, or returns random guid.

static function setRequestState(cryptoObj: ICrypto, userState?: string, meta?: Record<string, string>): string

Parameters

cryptoObj
ICrypto
userState

string

meta

Record<string, string>

Returns

string