Skip to main content
Check out our end-to-end guide on how to implement in-app verification.

Credential storage modes

In-app credentials can be stored either as a single credential for the device or as separate credentials per username. If you do not pass a username when adding, getting, removing, or verifying with an in-app credential, the SDK uses one credential for the device. This is useful for step-up verification when the current signed-in user is the only user expected to use the device credential. If a different user later adds an in-app credential on the same device without a username, the credential is rebound to that user. If you pass a username, the SDK stores and looks up a credential scoped to that username. This lets multiple users sign in on the same device without removing each other’s in-app credentials. Use the same username when calling addCredential, getCredential, removeCredential, and verify. PIN methods always require a username, because each PIN is associated with a username on the device.

Adding a credential

Adding an in-app credential generates a private/public key pair, where the private key is secured on the user’s mobile device and the public key is held by Authsignal. This operation must be authorized with a short-lived token, which can be obtained by tracking an action from your backend in an authenticated context.

Parameters

string
A short-lived token obtained by tracking an action.
string
An optional username used to store a separate in-app credential for this user on the device. Omit this value to use a single device credential.
boolean
When set to true, the SDK will generate a platform-specific attestation during enrollment:
  • iOS: Uses App Attest (DCAppAttestService) to generate an attestation bound to the device.
  • Android: Uses Play Integrity to generate an integrity token.
The attestation is generated internally by the SDK and sent to the Authsignal server for verification. This provides an additional layer of assurance that the credential is being enrolled from a legitimate app on a real device.

Response

AuthsignalResponse<AppCredential>

Getting a credential

Get information about the in-app credential stored on the device, if one exists.

Parameters

string
An optional username used to look up a credential scoped to that username. Omit this value to look up the single device credential.

Response

AuthsignalResponse<AppCredential>

Removing a credential

Parameters

string
An optional username used to remove the credential scoped to that username. Omit this value to remove the single device credential.

Response

AuthsignalResponse<boolean>

Verifying an action

Verify an action in your app using the credential stored securely on the device.

Parameters

string
An optional action code to use for the verification.
string
An optional username used to verify with the credential scoped to that username. Omit this value to verify with the single device credential.

Response

AuthsignalResponse<VerifyDeviceResponse>

Creating a PIN

Create a custom PIN backed by a cryptographic in-app credential stored securely on the user’s device.

Parameters

string
A short-lived token obtained by tracking an action.
string
The username associated with the PIN. A device can have multiple PINs stored for different users.
string
The PIN value. Must be a valid 6-digit numeric value.

Response

AuthsignalResponse<AppCredential>

Verifying a PIN

Check a submitted PIN value against the value stored on the device and use the associated in-app credential to verify the user.

Response

AuthsignalResponse<VerifyPinResponse>

Get PIN usernames on device

Get all the usernames for PINs currently stored on the device. This method can be used if allowing multiple users to create PINs on the same device.

Response

AuthsignalResponse<string[]>