[Bug]: Errors.User.WebAuthN.BeginLoginFailed
Author: Pedro642001Created Jul 10, 2024Updated Sep 30, 2026
Labelsarea/authTo-be-closed
Preflight Checklist
- I could not find a solution in the documentation, the existing issues or discussions
- I have joined the ZITADEL chat
Environment
Self-hosted
Version
2.55.2
Database
PostgreSQL
Database Version
16
Describe the problem caused by this bug
We are developing a perfil screen, where the user can change their login settings. The user sets up their U2F normaly. But, when the user start login on application, they get an error.
To reproduce
- On Backend, we use this endpoint to get the public credential with lib @zitadel/node:
const authServiceClient = this.createAuthClientZitadel(accessToken);
const response = await authServiceClient.addMyAuthFactorU2F({});
return {
publicKey: response.key?.publicKey.toString("base64url")!,
};- On frontend, we use this fuctions to parse the credential
create(parseCreationOptionsFromJSON( JSON.parse(atob(publicKey ?? '')) as CredentialCreationOptionsJSON ))- on frontend, we return data to backend with this params:
{
publicKeyCredential: publicKeyCredential.toJSON(),
tokenName
}- The backend send this data to Zitadel, we try two possibilities. But, the fist, we recive an error, so, we used the second option as an alternative:
const authServiceClient = this.createAuthClientZitadel(accessToken);
await authServiceClient.verifyMyAuthFactorU2F({
verification: {
publicKeyCredential: Buffer.from(base64url.encode(publicKeyCredential)),
tokenName,
},
});const authServiceClient = this.createUserClientZitadel(accessToken);
await authServiceClient.verifyU2FRegistration({
publicKeyCredential,
tokenName,
});- After that, when the user starts the login on Zitadel screen, he receives the error bellow:
Lib backend:
- "@zitadel/node": "^2.0.14"
Lib frontend:
- "@github/webauthn-json": "2.1.1"
Screenshots
No response
Expected behavior
No response
Operating System
No response
Relevant Configuration
No response
Additional Context
No response
Source: zitadel/zitadel