Global

Methods

extractIdToken(encoded) → {Object|null}

Decode ID token from

Source:
Parameters:
Name Type Description
encoded string

IdToken string

Returns:
Type:
Object | null
  • in cas of error null is returned

(async) getAllUserTokenKeys()

Return all tokens for the client ID the cache initialized with and given user ID. If userId omitted - for all users of current client ID

Source:

isIntersects(otherScope)

Copmare if the current instance scope intersects witt one from parameter Only NON basic scopes are compared

Source:
Parameters:
Name Type Description
otherScope Scope

isSubsetOf(newScope, otherScope) → {boolean}

Check if newScope is a subset of baseScope

Source:
Parameters:
Name Type Description
newScope Array
otherScope Array
Returns:
Type:
boolean

(async) request(method, url, bodyopt)

Helper function to send HTTP requests

Source:
Parameters:
Name Type Attributes Description
method String
url String
body Object <optional>

request body

serializeParams(params) → {string}

Helper function to serialize object into urlencoded form data string, properties which value is either null or undefined will be ignored.

Source:
Parameters:
Name Type Description
params Object

Object which contains props.

Returns:
Type:
string

Result form data string.

validate(rules, values)

Applies the validtion and transform rules to the given values

Possible rules: rules = { parameters: { // define rules for needed keys from values input object realm: {} // just declared without rules, not required by default state: {required: true}, // required nonce: {required: false, type: 'string'}, // not required, but if given must have type strng clientId: {toName: 'client_id'}, // key name transform rule }, validate: true | false // if true (default) - pass through only declared params aliases: { connection: 'realm', clientID: 'clientId' } } Actions:

  • removes not declared in rules values (can be disabled by 'validate: false' parameter)
  • checks if all required values are exist in values ('required: true')
  • cheks if all given typed parameters have a required type
  • all values are optional by default (without "required" rule)
Source:
Parameters:
Name Type Description
rules Object
values Object