mirror of
https://github.com/bitwarden/server.git
synced 2025-04-06 21:48:12 -05:00
[PM-5435] Handle Fido2VerificationException on WebAuthn 2FA (#3615)
* Handle Fido2VerificationException on WebAuthn 2FA * Linting!
This commit is contained in:
parent
37a22540a9
commit
94d665e6e9
@ -103,6 +103,8 @@ public class WebAuthnTokenProvider : IUserTwoFactorTokenProvider<User>
|
||||
// established ownership in this context.
|
||||
IsUserHandleOwnerOfCredentialIdAsync callback = (args, cancellationToken) => Task.FromResult(true);
|
||||
|
||||
try
|
||||
{
|
||||
var res = await _fido2.MakeAssertionAsync(clientResponse, options, webAuthCred.Item2.PublicKey, webAuthCred.Item2.SignatureCounter, callback);
|
||||
|
||||
provider.MetaData.Remove("login");
|
||||
@ -117,6 +119,12 @@ public class WebAuthnTokenProvider : IUserTwoFactorTokenProvider<User>
|
||||
|
||||
return res.Status == "ok";
|
||||
}
|
||||
catch (Fido2VerificationException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private bool HasProperMetaData(TwoFactorProvider provider)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user