Check out our end-to-end guide on how to implement QR code verification using
Authsignal.
Start a QR code challenge
Parameters
The action being performed.
A function that is called when the challenge state changes.
A function that is called when the challenge should be refreshed.
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.
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.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.The interval in milliseconds at which the challenge should be polled. Defaults to
5000 (5 seconds).Only relevant when polling is set to true.Response
Refresh a QR code challenge
challenge method will be re-used.
Parameters
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
Calldisconnect 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.

