dotnet / dotnet/aspnetcore

Microsoft.AspNetCore.Identity UserManager - Delete user AuthenticatorKey and RecoveryCodes

Open
#43,562 6 comments 4 reactions 0 assignees View on GitHub
area-identity
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

I miss a method for deleting `AuthenticatorKey `and `RecoveryCodes `for a user in `Microsoft.AspNetCore.Identity UserManager`. I can control nearly everything else but for some reason there is no method to remove these values.

### Describe the solution you'd like

I would like the following methods implemented:

```
public virtual async Task RemoveAuthenticatorKeyAsync(TUser user)

public virtual async Task RemoveTwoFactorRecoveryCodesAsync(TUser user)
```

I know it might be a risk and that the authenticator app will not work until you reconfigure the AuthenticatorKey again etc. However calling `ResetAuthenticatorKeyAsync `without calling `SetTwoFactorEnabledAsync(user, false);` or similar will have the same affect imo.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.