Skip to main content

Start a QR code challenge

Parameters

string
required
The action being performed.
function
required
A function that is called when the challenge state changes.
function
A function that is called when the challenge should be refreshed.
object
A JSON object which can include any key/value pairs. Can be used to provide additional context to the challenge which can be reviewed on the user’s mobile device.
number
The interval in milliseconds at which the challenge should be refreshed. Defaults to 540000 (9 minutes). This should be set to a value lower than your token’s expiry time to allow a tolerance for the challenge to be completed.
boolean
Whether to poll for the challenge result using RESTful API endpoints. Should only be used if you are unable to use WebSocket connections.Defaults to false and uses WebSockets.
number
The interval in milliseconds at which the challenge should be polled. Defaults to 3000 (3 seconds).Only relevant when polling is set to true.

Response

AuthsignalResponse<QrCodeChallengeResponse>

Refresh a QR code challenge

This can only be called after a QR code challenge has been initiated. The callback functions passed to the challenge method will be re-used.

Parameters

object
A JSON object which can include any key/value pairs. Can be used to update context to the challenge which can be reviewed on the user’s mobile device.

Disconnect a QR code challenge

Call disconnect to tear down the active challenge. This closes the WebSocket connection (or stops polling) and clears any refresh timers. Call it when the QR code is no longer displayed, for example when the user navigates away.