dotnet / dotnet/aspnetcore

Logging the reason behind "InvalidToken" response from UserManager.ConfirmEmailAsync method

Open
#52,906 2 comments 3 reactions 0 assignees View on GitHub
area-identity enhancement Pillar: Dev Experience
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

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.

**Problem**
I have been getting an "InvalidToken" response from the `ConfirmEmailAsync` [method](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.identity.usermanager-1.confirmemailasync?view=aspnetcore-7.0) in a .NET 7-based API project. Error description contains "Invalid token". The token can be invalid for multiple reasons, including missing characters, inconsistent data protection key and expiration. The reason should be logged otherwise debugging this problem becomes almost impossible.

### Describe the solution you'd like

The proper detailed reason for the email confirmation token being "invalid" should be logged by the framework.

### 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.