Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 24, 2025

Summary

Adds passkey (WebAuthn/FIDO2) authentication support to both Blazor Web App Identity scaffolders and synchronizes all Blazor Identity templates with the .NET 10 reference template.

Key Changes

Passkey Support

  • New files: PasskeyInputModel, PasskeyOperation, PasskeySubmit component with JavaScript, Passkeys management page, RenamePasskey page
  • Login integration: Updated Login.razor to support passkey authentication via PasskeySignInAsync
  • Navigation: Added Passkeys link to ManageNavMenu
  • Configuration: Set options.Stores.SchemaVersion = IdentitySchemaVersions.Version3 in Program.cs
  • Script inclusion: Added PasskeySubmit.razor.js module script to App.razor

Template Synchronization with .NET 10

  • Removed obsolete files: IdentityUserAccessor, AccountLayout
  • Added new page: AccessDenied.razor
  • Modernized all templates: File-scoped namespaces, proper nullable annotations, updated using statements
  • Fixed all 46 templates: Synchronized with upstream dotnet/aspnetcore reference
  • Applied to both scaffolders: VS.Web.CG.Mvc and dotnet-scaffold now have identical template sets

Fixes #3289

Copilot AI changed the title [WIP] Implement passkey support in Identity scaffolders for Blazor Web App Add passkey (WebAuthn/FIDO2) support to Blazor Identity scaffolder Oct 24, 2025
Copilot finished work on behalf of MackinnonBuck October 24, 2025 21:18
Copilot AI requested a review from MackinnonBuck October 24, 2025 21:18
@MackinnonBuck
Copy link
Member

@copilot there are widespread changes that happened to the Blazor Web App template in .NET 10 beyond just the passkey updates. The latest version of the template can be seen in https://github.com/dotnet/aspnetcore/tree/main/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1.

I've started to go through and apply the latest changes to both scaffolders, but there's more work to be done. For example, IdentityUserAccessor was removed from the project template, so related scaffolding files should be removed. I found some other issues locally, such as the lack of nullable annotations in some places.

Can you please go through all the files in the current version of the Blazor Web App project template and make sure the corresponding .tt files are up to date? Also delete any .tt, .cs, and .Interfaces.cs files that no longer map to files in the Blazor Web App template.

Don't write the generated .cs files by hand. If it's available, use TextTransform.exe to run the T4 generator. Otherwise, skip generating the .cs files for now and I'll do it myself later. Feel free to write the .Interfaces.cs files yourself, as those are straightforward, but make sure they match what's done in other files.

This comment was marked as resolved.

@MackinnonBuck
Copy link
Member

Continue updating all remaining templates systematically (will take time)?

@copilot Please do this. It may take time but I don't expect there to be massive changes remaining.

Copilot AI changed the title Add passkey (WebAuthn/FIDO2) support to Blazor Identity scaffolder Add passkey (WebAuthn/FIDO2) support and sync Blazor Identity scaffolder with .NET 10 template Oct 27, 2025
Copilot finished work on behalf of MackinnonBuck October 27, 2025 23:49

This comment was marked as resolved.

Copilot finished work on behalf of MackinnonBuck October 28, 2025 00:02
Copilot AI requested a review from MackinnonBuck October 28, 2025 15:41
@MackinnonBuck
Copy link
Member

Not directly relevant to this PR, but I found that this line often took 30 to 45 seconds to run, and it runs at the start of every dotnet scaffold execution (even if it's just dotnet scaffold --help). Maybe this can be changed to run lazily. I had to comment out that line to have a reasonably short inner dev loop. Happy to file an issue.

@MackinnonBuck
Copy link
Member

@copilot can you please re-write the original PR comment to concisely summarize the changes in this PR?

This comment was marked as duplicate.

Copilot AI requested a review from MackinnonBuck November 14, 2025 21:54
Copilot finished work on behalf of MackinnonBuck November 14, 2025 21:54
@haileymck
Copy link
Member

Not directly relevant to this PR, but I found that this line often took 30 to 45 seconds to run, and it runs at the start of every dotnet scaffold execution (even if it's just dotnet scaffold --help). Maybe this can be changed to run lazily. I had to comment out that line to have a reasonably short inner dev loop. Happy to file an issue.

yeah! can you file an issue for this

@haileymck
Copy link
Member

Looks good, sorry if I missed it somewhere, but how did you test these changes?

@MackinnonBuck
Copy link
Member

Looks good, sorry if I missed it somewhere, but how did you test these changes?

Good question! I used the following scripts to install the old and new scaffolders, respectively:

  • .\scripts\install-aspnet-codegenerator.cmd
  • .\scripts\install-scaffolder.cmd

Then, when testing the old scaffolder, I followed these steps:

  1. Make sure the latest .NET 10 SDK is installed
  2. Remove microsoft.visualstudio.web.codegeneration* packages from NuGet cache
  3. If not done already, create a new Blazor Web App using dotnet new blazor
  4. Run the following commands to install required packages:
    dotnet add package Microsoft.EntityFrameworkCore.Design
    dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design -v 10.0.0-dev
    dotnet add package Microsoft.EntityFrameworkCore.Sqlite
    dotnet add package Microsoft.EntityFrameworkCore.Tools
    dotnet add package Microsoft.AspNetCore.Identity.EntityFrameworkCore
    
  5. Run the code generator, e.g.:
    dotnet aspnet-codegenerator blazor-identity -dbProvider sqlite
    
  6. Run dotnet ef migrations add InitialCreate -o .\Data\Migrations to add a migration
  7. Run dotnet ef database update to initialize the database
  8. Run dotnet run to test the app

For testing the new scaffolder:

  1. Make sure the latest .NET 10 SDK is installed
  2. If not done already, create a new Blazor Web App using dotnet new blazor
  3. Run dotnet scaffold and select Blazor > Blazor Identity (dotnet-scaffold) > {Project name} > "ApplicationDbContext" > sqlite-efcore > (Overwrite existing files?) Yes > (Include Prerelease packages?) Yes
  4. Run dotnet ef migrations add InitialCreate -o .\Data\Migrations to add a migration
  5. Run dotnet ef database update to initialize the database
  6. Run dotnet run to test the app

@MackinnonBuck
Copy link
Member

yeah! can you file an issue for this

Opened an issue here: #3318

@haileymck
Copy link
Member

ok great! approved!

haileymck
haileymck previously approved these changes Nov 15, 2025
@MackinnonBuck MackinnonBuck merged commit 55f8f53 into main Nov 17, 2025
8 checks passed
@MackinnonBuck MackinnonBuck deleted the copilot/add-passkey-support-identity-scaffolders branch November 17, 2025 17:08
phenning added a commit that referenced this pull request Nov 21, 2025
* add comments

* [main] Update dependencies from dotnet/arcade (#3198)

* Update dependencies from https://github.com/dotnet/arcade build 20250905.5

Microsoft.DotNet.Arcade.Sdk
 From Version 11.0.0-beta.25453.1 -> To Version 11.0.0-beta.25455.5

* Update dependencies from https://github.com/dotnet/arcade build 20250907.1

Microsoft.DotNet.Arcade.Sdk
 From Version 11.0.0-beta.25453.1 -> To Version 11.0.0-beta.25457.1

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* bump package versions in sh scripts (#3196)

* add comments (#3193)

* bump NuGet package versions in install scripts (#3191)

* add comments (#3195)

* add comments (#3194)

* Update scaffolding package version to RC2 (#3201)

* Update scaffolding package version to RC2

* update DotNetScaffold props

* Update dependencies from https://github.com/dotnet/arcade build 20250908.3 (#3205)

Microsoft.DotNet.Arcade.Sdk
 From Version 11.0.0-beta.25457.1 -> To Version 11.0.0-beta.25458.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* bump backupDotNetScaffoldVersion to 10.0.0 (#3202)

* change the application name from "dotnet-scaffold" to "dotnet scaffold" (#3203)

* remove second arcade folder (#3206)

* Update dependencies from https://github.com/dotnet/arcade build 20250909.1 (#3211)

Microsoft.DotNet.Arcade.Sdk
 From Version 11.0.0-beta.25458.3 -> To Version 11.0.0-beta.25459.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Call build.sh/.cmd directly to avoid multiple publish (#3209)

* Call build.sh/.cmd directly to avoid multiple publish

Only call publish from windows debug strategy

* add component help description (#3207)

* Add comments to dotnet-scaffold-aspire (#3213)

* add tool installation help (#3208)

* Update dependencies from https://github.com/dotnet/arcade build 20250911.3 (#3219)

Microsoft.DotNet.Arcade.Sdk
 From Version 11.0.0-beta.25459.1 -> To Version 11.0.0-beta.25461.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* add comments to dotnet-scaffold-aspnet (#3214)

* add comments to scaffolding core (#3215)

* add comments to text templating (#3216)

* don't wait forever for a CLI command (#3218)

* Update dependencies from https://github.com/dotnet/arcade build 20250912.2 (#3224)

On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25461.3 -> To Version 11.0.0-beta.25462.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* az CLI commands are caught correctly (#3233)

* Update dependencies from https://github.com/dotnet/arcade build 20250917.6 (#3237)

On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25462.2 -> To Version 11.0.0-beta.25467.6

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* [main] Update dependencies from dotnet/arcade (#3239)

* Update dependencies from https://github.com/dotnet/arcade build 20250918.5
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25467.6 -> To Version 11.0.0-beta.25468.5

* Update dependencies from https://github.com/dotnet/arcade build 20250919.3
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25467.6 -> To Version 11.0.0-beta.25469.3

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Run Spectre.Console experience when not using --non-interactive (#3247)

* move interactive experience to interactive dir in dotnet-scaffold (#3252)

* removed unused code (#3258)

* remove unused code (#3257)

* [main] Update dependencies from dotnet/arcade (#3259)

* Update dependencies from https://github.com/dotnet/arcade build 20250926.3
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25469.3 -> To Version 11.0.0-beta.25476.3

* Update dependencies from https://github.com/dotnet/arcade build 20250927.2
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25469.3 -> To Version 11.0.0-beta.25477.2

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Combine aspire scaffolders under dotnet-scaffold (#3255)

* remove dotnet-scaffold-aspire

* Show aspire commands under dotnet scaffold command

* [main] Update dependencies from dotnet/arcade (#3261)

* Update dependencies from https://github.com/dotnet/arcade build 20250929.7
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25477.2 -> To Version 11.0.0-beta.25479.7

* Update dependencies from https://github.com/dotnet/arcade build 20250930.1
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25477.2 -> To Version 11.0.0-beta.25480.1

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Update dependencies from https://github.com/dotnet/arcade build 20251001.1 (#3264)

On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25480.1 -> To Version 11.0.0-beta.25501.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* move Aspire commands to file, consolidate aspire strings (#3263)

* simplify the Getting-Started.md (#3260)

* Pin Build.Tasks.Core package version, add es-metadata.yml (#3265)

* invoke "dotnet-scaffold aspire" for aspire commands (#3262)

* [main] Update dependencies from dotnet/arcade (#3267)

* Update dependencies from https://github.com/dotnet/arcade build 20251002.2
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25501.1 -> To Version 11.0.0-beta.25502.2

* Update dependencies from https://github.com/dotnet/arcade build 20251003.2
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25501.1 -> To Version 11.0.0-beta.25503.2

* Update dependencies from https://github.com/dotnet/arcade build 20251004.3
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25501.1 -> To Version 11.0.0-beta.25504.3

* Update dependencies from https://github.com/dotnet/arcade build 20251006.2
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25501.1 -> To Version 11.0.0-beta.25506.2

* Update dependencies from https://github.com/dotnet/arcade build 20251007.4
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25501.1 -> To Version 11.0.0-beta.25507.4

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* do not recognize old aspire package (#3272)

* Invoke Aspire commands directly with System.CommandLine (#3271)

* Invoke Aspire commands directly with System.CommandLine

* return exit code from the running the CLI command

* separate out aspnet strings (#3266)

* Update dependencies from https://github.com/dotnet/arcade build 20251008.3 (#3274)

On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25507.4 -> To Version 11.0.0-beta.25508.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Fold aspnet under dotnet scaffold (#3273)

* move files and update Program.cs

* remove scripts and ignore "dotnet-scaffold-aspnet" tool

* change Console to AnsiConsole and fix build

* remove the other first party tool

* invoke dotnet scaffold aspnet commands directly

* fix build

* register scaffold steps explicitly, not using reflection

* update scripts refrenced in Getting-Started.md (#3281)

* Update dependencies from https://github.com/dotnet/arcade build 20251009.1 (#3283)

On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25508.3 -> To Version 11.0.0-beta.25509.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Simplify the dotnet scaffold option setting logic (#3282)

* Aspire command options separated

* move aspnet options out

* PR comments

* add descriptions to --help (#3284)

* remove first party component initializer (#3285)

* [main] Update dependencies from dotnet/arcade (#3288)

* Update dependencies from https://github.com/dotnet/arcade build 20251020.4
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25509.1 -> To Version 11.0.0-beta.25520.4

* Update dependencies from https://github.com/dotnet/arcade build 20251022.1
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25509.1 -> To Version 11.0.0-beta.25522.1

* Update dependencies from https://github.com/dotnet/arcade build 20251024.1
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25509.1 -> To Version 11.0.0-beta.25524.1

* Update dependencies from https://github.com/dotnet/arcade build 20251027.2
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25509.1 -> To Version 11.0.0-beta.25527.2

* Update dependencies from https://github.com/dotnet/arcade build 20251028.1
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25509.1 -> To Version 11.0.0-beta.25528.1

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Update dependencies from https://github.com/dotnet/arcade build 20251030.1 (#3294)

On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25528.1 -> To Version 11.0.0-beta.25530.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Blazor CRUD uses `NotFound()` method and re-execution middleware (#3290)

* Apply changes from the original PR.

* Test the new file addition.

* Add method that will update Router + move NotFound file out of CRUD dir (it's a page not connected to CRUD only).

* Add re-execution middleware.

* Adapt replacement for blazor wasm to match old scaffolder's code.

* Fix layout of not found page rendered on `NotFound` call.

* Re-generate the file after adding layout to NotFound page.

* Revert `CallContext` namespace change.

* Feedback: conditonal layout.

* do not have duplicate usernames entra id (#3297)

* [main] Update dependencies from dotnet/arcade (#3295)

* Update dependencies from https://github.com/dotnet/arcade build 20251031.1
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25530.1 -> To Version 11.0.0-beta.25531.1

* Update dependencies from https://github.com/dotnet/arcade build 20251103.1
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25530.1 -> To Version 11.0.0-beta.25553.1

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Update dependencies from https://github.com/dotnet/arcade build 20251104.2 (#3302)

On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25553.1 -> To Version 11.0.0-beta.25554.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* do not create static scaffolder options (#3301)

* Update dependencies from https://github.com/dotnet/arcade build 20251105.5 (#3306)

On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25554.2 -> To Version 11.0.0-beta.25555.5

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* install msidentity for entra id if not installed (#3307)

* [main] Update dependencies from dotnet/arcade (#3308)

* Update dependencies from https://github.com/dotnet/arcade build 20251106.3
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25555.5 -> To Version 11.0.0-beta.25556.3

* Update dependencies from https://github.com/dotnet/arcade build 20251107.2
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25555.5 -> To Version 11.0.0-beta.25557.2

* Update dependencies from https://github.com/dotnet/arcade build 20251110.1
On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25555.5 -> To Version 11.0.0-beta.25560.1

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Fix writing to console breaking UI (#3304)

* do not write error messages when building scaffolders

* use service to display the errors for configuring Entra ID

* couple nuget packages with package versions (#3312)

* Update dependencies from https://github.com/dotnet/arcade build 20251112.6 (#3313)

On relative base path root
Microsoft.DotNet.Arcade.Sdk From Version 11.0.0-beta.25560.1 -> To Version 11.0.0-beta.25562.6

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Update `dotnet-scaffold.csproj` to include .tt files (#3314)

* Update `dotnet-scaffold.csproj`

* Add template files to project packaging

* Add .azuredevops/dependabot.yml

* Add .azuredevops/dependabot.yml

* Add passkey (WebAuthn/FIDO2) support and sync Blazor Identity scaffolder with .NET 10 template (#3291)

Co-authored-by: MackinnonBuck <[email protected]>
Co-authored-by: Mackinnon Buck <[email protected]>

* small nuget package changes (#3316)

* updated microsoft.dotnet.scaffolding.shared target framework (#3317)

* Update macOS runner to latest (#3320)

macOS-13 is being deprecated per actions/runner-images#13046

* Blazor CRUD uses `NotFound()` method instead of navigation (#3162)

* Remove `NavigateTo(\"notfound\")` from Blazor CRUD.

* Attempt of adding `NotFoundPage` parameter to `Router.razor`.

* Add copilot-made templates that should in theory result in creating `NotFound.razor`.

* Fix.

* Fix namespace.

* Fix replace blocks.

* Update to net 10 GA packages (#3319)

* Update to GA packages

* Update other build versions.

* Revert aome version updates, remove NU1701 NoWarn

* Update Microsoft.Build to highest net8.0 secure compatibile version

* Set Stable package versions for dotnetscaffold and scaffolding packages

* Update System.Commandline to GA version

* Remove reflection call.

* calculate the AZ param dynamically (#3326)

---------

Co-authored-by: haileymck <[email protected]>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Ilona Tomkowicz <[email protected]>
Co-authored-by: Mackinnon Buck <[email protected]>
Co-authored-by: Matt Mitchell <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: MackinnonBuck <[email protected]>
Co-authored-by: Drew Noakes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Passkey authentication support to Identity scaffolders for .NET 10

3 participants