NoPass

Documentation

NoPass integration is built in to the Auth Lib Core. There are also extensions for it in the Auth Button and Auth Bar to add additional UI on top.

The NoPass script is included asynchronously only if needed.

Example Usage

For an example usage of NoPass in the Auth Bar, click here

Enabling NoPass

1. Create an attribute in the NoPass service:

curl https://nopass-api-dev.tr-api-services.net/v1/browser.atrribute.create -d'{"attribute":{"name":"UNIQUE.NAMESPACE.HERE", "friendly_name": "FRIENDLY NAME"}}' 

2. Enable NoPass in your AuthLib config:

AuthLib.config({
                    ...,
                    enableNoPass: true,
                    noPassAttributeName: "UNIQUE.NAMESPACE.HERE"
                });

3. Call the NoPass methods (described below)

NoPass Parameters

enableNoPass (Optional)

AuthLib.config({enableNoPass: true})
Default: false
Enable or disable NoPass integration

noPassAttributeName (Mandatory if enableNoPass = true)

AuthLib.config({noPassAttributeName: "UNIQUE.NAMESPACE.HERE"})
You MUST specify the attribute name here if you enable NoPass

NoPass Methods

onload

AuthLib.NoPass.onload(callback)
As the NoPass library is loaded asynchronously, this method is provided to allow your code to be called back when the NoPass library has been loaded
callback (Mandatory) - The callback function
Returns: void

isLinked

AuthLib.NoPass.isLinked()
Returns true if the current browsing session is linked to a phone
Returns: boolean

linkedDeviceName

AuthLib.NoPass.linkedDeviceName()
Returns the name of the phone the the browsing session is linked to
Returns: string

unlink

AuthLib.NoPass.unlink()
Call this to remove the linkage between the browsing session and the phone
Returns: void

login

AuthLib.NoPass.login(domElementID)
Call this method to initiate the login process using NoPass.
domElementID (Optional) - The ID of the DOM element to place the QR code in to
Returns: Promise<boolean>

saveLogin

AuthLib.NoPass.saveLogin(domElementID)
Call this method to initiate the saving of a login state to a phone via NoPass
domElementID (Optional) - The ID of the DOM element to place the QR code in to
Returns: Promise<boolean>