Skip to content

Support passwordless account creation - #68648

Merged
rolandVi merged 5 commits into
dotnet:mainfrom
rolandVi:passkeys/passwordless-account
Sep 16, 2026
Merged

rolandVi merged 5 commits into
dotnet:mainfrom
rolandVi:passkeys/passwordless-account

Conversation

@rolandVi

Copy link
Copy Markdown
Member

Builds on #68522.

You can now sign up on the Blazor template with a passkey and no password. Today the register page insists on a password, so the only route to a passkey is to invent one first, sign in, and go find the manage page.

Design notes

Registration gets its own anonymous endpoint rather than relaxing /Account/Manage/PasskeyCreationOptions, which stays behind RequireAuthorization() and the reauthentication check. It never looks up an existing account: reusing one's ID would let anyone type your address, make a passkey, and have it attached to your account.

The address runs through the same validators CreateAsync uses before any options go out, so a taken one is refused before you are asked for a fingerprint and left holding a passkey the server never stored.

Login page fix

Login.razor is in here too. Both ceremonies keep their state in one shared cookie, and the login page starts one by itself for autofill, so two tabs can collide, which throws instead of failing and gives a 500. That was hard to hit before. With Register one click from Login, it is not.

Resolves #67297.

@rolandVi
rolandVi requested a review from rokonec August 19, 2026 12:32
@rolandVi
rolandVi requested a review from a team as a code owner August 19, 2026 12:32
@rolandVi rolandVi added the area-identity Includes: Identity and providers label Aug 19, 2026
@rolandVi

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
4 pipeline(s) were filtered out due to trigger conditions.

@rolandVi
rolandVi changed the base branch from rolandVi/passkey-work to main August 26, 2026 09:20
@rolandVi
rolandVi requested a review from SamMonoRT as a code owner August 26, 2026 09:20
Copilot AI lite review requested due to automatic review settings September 1, 2026 13:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Enables passwordless (passkey-first) registration in the Blazor “Individual Accounts” template by adding a dedicated anonymous passkey registration-options endpoint and wiring the Register page to initiate a WebAuthn attestation flow without requiring a password. It also hardens the Login flow against passkey ceremony-state collisions (multi-tab) that can otherwise surface as 500s.

Changes:

  • Add passkey-based registration flow (client + server) and UI entry point on /Account/Register.
  • Add an anonymous /Account/PasskeyRegistrationOptions endpoint that validates the email before starting the ceremony.
  • Fix passkey login to handle ceremony cookie collisions gracefully; expand template test coverage for passkey-only accounts.
File summaries
File Description
src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Shared/PasskeySubmit.razor.js Adds “Register” ceremony support and improves server error surfacing for fetch calls.
src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/PasskeyOperation.cs Adds Register enum value for passkey-submit operation selection.
src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/Register.razor Adds “Sign up with a passkey” path and server-side handler for creating the account around the attested user handle.
src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/Login.razor Prevents 500s by handling passkey ceremony-state collisions as a user-facing “session expired” error.
src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/IdentityComponentsEndpointRouteBuilderExtensions.cs Adds /PasskeyRegistrationOptions endpoint that validates email and runs UserValidators before returning creation options.
src/ProjectTemplates/test/Templates.Blazor.Tests/BlazorTemplateTest.cs Adds an E2E scenario covering passkey-only registration and subsequent sign-in behavior.
src/Identity/Core/src/SignInManager.cs Clarifies guidance in XML docs around “initial credential” vs adding passkeys to existing accounts.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@rolandVi

Copy link
Copy Markdown
Member Author

/azp run aspnetcore-ci

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@rolandVi
rolandVi requested a review from rokonec September 15, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-identity Includes: Identity and providers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support passwordless account creation

3 participants