Passkey authentication failure due to RPID mismatch

Hello,

I am facing a passkey authentication during cross device authentication. After I called completeAssertionRequest with passkeyCredential, I am encountering the issue attach and I am unable to find where the RPID mismatch is coming from and referencing from. It would be great if I could know the source of where RPID hash (found). Thanks.

Returned credential failed validation: Error Domain=com.apple.AuthenticationServicesCore.AuthorizationError Code=14 "RPID hash did not match expected value. Expected xMTokW1VIYg2DZVB9lCtheT+0n8NxHvx4HaxTPhH4bY=, found: eE1Ub2tXMVZJWWcyRFpWQjlsQ3RoZVQtMG44TnhIdng=." UserInfo={NSLocalizedFailureReason=RPID hash did not match expected value. Expected xMTokW1VIYg2DZVB9lCtheT+0n8NxHvx4HaxTPhH4bY=, found: eE1Ub2tXMVZJWWcyRFpWQjlsQ3RoZVQtMG44TnhIdng=.}

Answered by khantzawko in 788950022

I have found a solution, RPID hash is computed based on authenticatorData which has to be 32 bytes as per WebAuthn specs that you pass along with ASPasskeyAssertionCredential object.

Accepted Answer

I have found a solution, RPID hash is computed based on authenticatorData which has to be 32 bytes as per WebAuthn specs that you pass along with ASPasskeyAssertionCredential object.