
- Registering a mobile device for trusted device authentication by adding a device credential. This step creates a new public/private key pair.
- Responding to an authentication request by approving or rejecting a device challenge. This step uses the device’s private key to sign a message which is verified on the server using the public key.
Sequence diagram
Grab your Authsignal credentials
Head to Settings and grab your Tenant ID, API URL and API secret key. Add them as environment variables in your project:Implementing registration
1. Backend - Generate registration token
Track an action (e.g. “addAuthenticator”) to generate a short-lived token which can be used to authorize adding a new authentication method for a user.2. Mobile app - Add device credential
Use the token obtained in step 1 to register a new device credential in the app.Device registration should be implemented after login or when the app is launched in an
authenticated state. Registration tokens should only ever be generated for authenticated users in
order to ensure a strong binding between
authentication methods.
Implementing authentication
1. Backend - Track an action (optional)
Skip to step 2 if you don’t need to run rules on the action for adaptive MFA or want to associate additional data with the action through the custom data field. Track an action from your backend using our Server SDK or Server API.state
and token
to your mobile app. On your mobile app, check the state
parameter to conditionally challenge the user. If the state
is CHALLENGE_REQUIRED
, call the setToken
method to set the token.
The
ALLOW
state only works if you are building your own challenge dialog. If you have created
device credentials using the userAuthenticationRequired
flag, you are restricted to using the
CHALLENGE_REQUIRED
and BLOCK
states. To learn more, see our Device
SDK documentation.2. Mobile App - Verify the device
Use our Mobile SDK to verify the device. If the device credentials were created without using theuserAuthenticationRequired
flag, you may optionally present your own challenge dialog such as a PIN screen prior to calling the verify
method.
If the device credentials were created using the userAuthenticationRequired
flag, the OS will present the challenge dialog upon calling the verify
method. To learn more, see our Mobile SDK documentation.
3. Backend - Validate the challenge
Note that if you did not track an action in step 1, you will need to pass the
action
to the
validate challenge API. This allows us to associate the challenge with the action for analytics.token
returned from the previous step to your backend.
Your backend should call the validate challenge API to validate the challenge.
Next steps
- Push notification - Implement push notification authentication
- QR code - Implement QR code authentication
- Passkeys - Offer the most secure and user-friendly passwordless authentication
- Adaptive MFA - Set up smart rules to trigger authentication based on risk