This sample demonstrates using IdentityServer v8 with Duende User Management to register a new user and set a password.
When navigating to the password-registration sample the /Index page presents the user with 2 choices, Login or Register.
To register, a user will enter their email address, which is then validated by emailing an OTP code and waiting for the user to enter it. After the user proves they own the email address by entering the OTP, they are signed in and redirected to the /SetPassword page to create a password. Once the password is set, the user is signed out and redirected to the /Login page to sign-in with email/password.
After user sign-in, the /Index page displays user claims and custom data from the user's Attributes stored by User Management. The attributes can be modified by clicking on the Manage Account button.
The UserAttributes.Email attribute has the .IsUnique property set to true. This is required to ensure the password is tied to that email address.
- .NET 10 SDK
- Docker (for Mailpit email testing via Aspire)
cd UserManagementPasswordRegistration.AppHost
dotnet runThis launches:
| Service | URL |
|---|---|
| UserManagementPasswordRegistration | https://password-registration.dev.localhost:6010 |
| Mailpit UI | http://mailpit-aspire.dev.localhost:8026 |
| Mailpit SMTP | smtp://localhost:1026 |
| Aspire Dashboard | https://aspire.dev.localhost:17031 |