Authentication tokens
All backend SDKs require anauthToken. This can be:
- A Service Account token — long-lived, for server-to-server automation
- A Personal Access Token (PAT) — long-lived, tied to a specific user
- A User login token — short-lived, issued after user authentication
Request signing
All state-changing requests (POST, PUT, DELETE) must be cryptographically signed. The SDK handles this automatically when you configure a key signer. The signing flow works as follows:- Your SDK sends the request payload to Dfns
- Dfns returns a User Action Challenge
- Your SDK signs the challenge with your private key
- The signed challenge is sent back to complete the request
For a detailed explanation, see Signing requests.
Key signer
Each backend SDK provides a key signer that takes your credential ID and PEM-encoded private key. All SDKs support the same key types:| Algorithm | Description |
|---|---|
| Ed25519 | Edwards-curve Digital Signature Algorithm |
| ECDSA | Elliptic Curve DSA (P-256, secp256k1) |
| RSA | RSA PKCS#1 v1.5 with SHA-256 |
Settings > Service Accounts or Settings > Personal Access Tokens.
Direct vs delegated signing
Backend SDKs support two client patterns:Direct signing
Use the standard client when your backend has the private key and signs requests itself. This is the most common pattern for service accounts and automation. The SDK handles the full signing flow internally — you just call API methods and the signing happens transparently.Delegated signing
Use the delegated client when the private key is not on your backend — for example, when users sign with passkeys on their own device, or when the key lives in an external KMS. The delegated client splits every state-changing operation into two steps:- Init — your backend sends the request and receives a challenge
- Complete — your backend sends the challenge (signed externally) to finish the request
The Go SDK does not have a delegated client yet. Use the TypeScript or Python SDK for delegated signing flows.
