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!
User signing flow using a Fido2 passkey
Example with a Fido2 passkey, where the use signs the challenge in your frontend:User signing process using Fido2 passkeys
Backend signing flow using an asymetric key pair
Your backend can use a service account to call the Dfns API, but the service account will also be required to sign its sensitive requests. When creating a service account, you will have to generate a key pair and register its public key with Dfns. The private key is used to sign the challenges.Backend signing process using asymetric keys
