CreateCredentialResponse error with Credential Manager API on Android with Passkeys

291 views Asked by At

I'm trying to implement authentication using the Credential Manager API on Android. While setting up the CreatePublicKeyCredentialRequest, I'm encountering an error: Unexpected exception type androidx.credentials.exceptions.CreateCredentialNoCreateOptionException.

Here's the sanitized JSON I'm sending:

{
  "rp": {
    "name": "[AppName]",
    "id": "[AppDomain]"
  },
  "authenticatorSelection": {
    "authenticatorAttachment": "platform",
    "requireResidentKey": true,
    "residentKey": "required",
    "userVerification": "required"
  },
  "user": {
    "name": "[UserEmail]",
    "displayName": null,
    "id": "[UserId]"
  },
  "pubKeyCredParams": [
    {
      "type": "public-key",
      "alg": -7
    },
    {
      "type": "public-key",
      "alg": -257
    }
  ],
  "timeout": 60000,
  "attestation": "none",
  "excludeCredentials": [],
  "challenge": "[ChallengeCode]"
}

For reference, I've been following the example provided in the Google Developer docs and made sure the parameters match.

Despite following the guidelines and ensuring the JSON structure is accurate, the error persists. Any insights on what might be causing this and how to resolve it would be appreciated.

0

There are 0 answers