-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Add reset password support to identity endpoints #47231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
api-approved
API was approved in API review, it can be implemented
area-identity
Includes: Identity and providers
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
feature-token-identity
Priority:0
Work that we can't release without
Milestone
Comments
5 tasks
This was referenced Mar 17, 2023
This was referenced Jul 21, 2023
mkArtakMSFT
pushed a commit
that referenced
this issue
Jul 21, 2023
Backport of #49498 to release/8.0-preview7 /cc @halter73 # Add more MapIdentityApi endpoints ## Description This adds the following new endpoints: - GET /confirmEmail - POST /resendConfirmationEmail - POST /resetPassword - GET /account/2fa - POST /account/2fa - GET /account/info - POST /account/info Additionally, the existing /login endpoint now accepts 2fa codes and 2fa recovery codes as part of the request body. These can be queried and regenerated from /account/2fa. The /login endpoint now also gives limited failure reasons in the form of application/problem+json instead of empty 401 responses with details such as "LockedOut", "RequiresTwoFactor", "NotAllowed" (usually because lack of email confirmation), and the generic "Failed" statuses. Fixes #47232 (lockout support) Fixes #47231 (reset password support) Fixes #47230 (2fa support) Fixes #47229 (change username and password) Fixes #49404 (Removes AddIdentityBearerToken which is no longer needed) ## Customer Impact This makes the MapIdentityApi API introduced in preview4 more usable. See https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-4/#auth where we promised the following. > In addition to user registration and login, the identity API endpoints will support features like two-factor authentication and email verification in upcoming previews. You can find a list of planned features in the issues labeled [feature-token-identity](https://github.com/dotnet/aspnetcore/issues?q=is%3Aopen+label%3Afeature-token-identity+sort%3Aupdated-desc) on the ASP.NET Core GitHub repository. This PR adds all of these features, and it's important to make this available to customers as soon as possible, so we have time to react to any feedback. It appears customers are [excited to give it a go.](https://www.reddit.com/r/programming/comments/13jxcsx/aspnet_core_updates_in_net_8_preview_4_net_blog/jki0p3g/) ## Regression? - [ ] Yes - [x] No ## Risk - [ ] High - [ ] Medium - [x] Low This is primarily new API with minimal changes to SignInManager that should have no impact unless used by the new MapIdentityApi endpoints. ## Verification - [x] Manual (required) - [x] Automated ## Packaging changes reviewed? - [ ] Yes - [ ] No - [x] N/A
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
API Review Notes:
API Approved! // Microsoft.Extensions.Identity.Core.dll
+ namespace Microsoft.AspNetCore.Identity.UI.Services;
+ public interface IEmailSender
+ {
+ Task SendEmailAsync(string email, string subject, string htmlMessage);
+ }
+ public sealed class NoopEmailSender : IEmailSender
+ {
+ public Task SendEmailAsync(string email, string subject, string htmlMessage) => Task.CompletedTask;
+ }
// Microsoft.AspNetCore.Identity.UI.dll
+ [assembly: TypeForwardedTo(typeof(IEmailSender))] |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
api-approved
API was approved in API review, it can be implemented
area-identity
Includes: Identity and providers
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
feature-token-identity
Priority:0
Work that we can't release without
Background and Motivation
Add email confirmation and reset password support to identity endpoints.
Proposed API
Usage Examples
https://www.twilio.com/blog/how-to-send-asp-net-core-identity-emails-with-twilio-sendgrid
Alternative Designs
Create a new duplicate interface in a better namespace like just
Microsoft.AspNetCore.Identity
. Possibly use different methods for different kind of emails. E.g.SendConfirmationEmail
,SendPasswordResetEmail
, etc... Maybe this could be parameterized byTUser
.Risks
If people wanted to use Identity UI and Identity API endpoints in the same app with different email senders. This could make that hard or impossible to do.
The text was updated successfully, but these errors were encountered: