Class: Auth

Auth()

Authentication singleton for logging in and out of SlashDB instances.

Constructor

new Auth()

Source:

Methods

(async) clientIsAuthenticated(instanceNameopt) → {boolean}

Check if client authenticated

Parameters:
Name Type Attributes Default Description
instanceName string <optional>
default

instance to log out; if not provided, the default instance is checked

Source:
Returns:

flag indicating if client is currently authenticated to SlashDB instance

Type
boolean

(async) login(username, password, sdbClient, fnc)

Log into a SlashDB instance with a username and password. Executes provided function on successful login

Parameters:
Name Type Description
username string

user to log into SlashDB instance with

password string

password for user

sdbClient SlashDBClient

a SlashDBClient object containing SlashDB host config, obtained from calling the useSetUp hook

fnc function

function to be executed after successful login

Source:

(async) loginSSO(popUp, sdbClient, fnc)

Logs in to SlashDB instance. Only required when using SSO.

Parameters:
Name Type Description
popUp boolean

optional flag to sign in against the identity provider with a Pop Up window (false by default)

sdbClient SlashDBClient

a SlashDBClient object containing SlashDB host config, obtained from calling the useSetUp hook

fnc function

function to be executed after successful login

Source:

(async) logout(fnc, instanceNameopt)

Log out of SlashDB instance

Parameters:
Name Type Attributes Description
fnc function

to be executed after logout. Eg. push route away from restricted area of application.

instanceName string <optional>

instance to log out; if not provided, all registered instances are logged out

Source:

(async) refreshSSO()

Refreshes the SSO access token.

Source:

(async) updateSSO(sso)

Logs in to SlashDB instance. Only required when using SSO.

Parameters:
Name Type Description
sso Object

optional settings to login with Single Sign-On

Properties
Name Type Description
idpId string

optional identity provider id configured in SlashDB

redirectUri string

optional redirect uri to redirect browser after sign in

popUp boolean

optional flag to sign in against the identity provider with a Pop Up window (false by default)

Source: