Create credential challenge with code
Creates a credential challenge using a one-time code. This challenge must be signed by the new credential before you finalize the Create Credential With Code flow.
- HTTP request
- POST /auth/credentials/code/init
- Request body
-
Field Type Required Description credentialKindenum (string) Yes The type of credential to create. Valid values: Fido2,Key,Password,Totp,RecoveryKey,PasswordProtectedKey.codestring Yes The one-time code generated during the first step of the flow. Minimum length: 1. curl --request POST \ --url https://api.digitalassets.ibm.com/auth/credentials/code/init \ --header 'Content-Type: application/json' \ --data ' { "credentialKind": "Fido2", "code": "<string>" } ' - Response
- 200: Success
The structure of the response depends on the credential type. The following describes the FIDO2 response.
Example response:
{ "kind": "Fido2", "user": { "id": "<string>", "displayName": "<string>", "name": "<string>" }, "challengeIdentifier": "<string>", "challenge": "<string>", "authenticatorSelection": { "residentKey": "required", "requireResidentKey": true, "userVerification": "required", "authenticatorAttachment": "platform" }, "attestation": "none", "pubKeyCredParams": [ { "type": "public-key", "alg": 123 } ], "excludeCredentials": [ { "type": "public-key", "id": "cr-6uunn-bm6ja-f6rmod5kqrk5rbel" } ], "temporaryAuthenticationToken": "<string>", "rp": { "id": "<string>", "name": "<string>" } }