Overall process
Signing is a four-steps process:1
Get a challenge from the Dfns system.
A signing challenge is returned from a call to: Get a User Action ChallengeYou will receive an object with the following properties (additional properties exist for signing with WebAuthn):
| field | description |
|---|---|
| challenge | A string that will be signed with your private key |
| challengeIdentifier | A JWT that identifies the signing session |
| allowCredentials | The list of private key credentials that are enabled for the user |
2
Sign the challenge
This step differs depending on the type of credential you are using:
- Human users often use passkeys, with which the signing process is all managed by their OS and browser in the frontend (website, mobile app, etc).
- Machine users use asymetric keys that you need to use in the backend with a crypto library.
allowCredentials.See the example flow below.3
Return the signed challenge to the Dfns system
Call the endpoint: Create the User Action SignatureYou will need to provide the base64url-encoded signed challenge from the previous step, as well as the (base64url-encoded) client data and the id of the credential that was used to sign.You will receive a token to use in the next step. This token is only valid once.
4
Get back a User Action Signature, and include it with your original API call
This is when you call the actual endpoint you needed to call all along!
