Skip to content

Commit 79f5e62

Browse files
committed
Add passkey sample
1 parent 0852d3e commit 79f5e62

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

  • src/content/docs/identityserver/samples

src/content/docs/identityserver/samples/aspid.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,32 @@ In the client application:
5555
href="https://github.com/DuendeSoftware/Samples/tree/main/IdentityServer/v7/AspNetIdentity"
5656
title="ASP.NET Identity Sample"
5757
target="_blank"
58+
/>
59+
60+
# ASP.NET Identity Passkey :badge[.NET 10]
61+
62+
This sample shows how to port passkey support from a .NET 10 Blazor App project template into Duende IdentityServer.
63+
64+
:::note[.NET 10 preview 7]
65+
This sample was written using the functionality available in .NET 10 preview 7.
66+
The final .NET 10 release may provide a different API surface.
67+
:::
68+
69+
It is based on the [_Duende IdentityServer with ASP.NET Core Identity_](/identityserver/overview/packaging.mdx#duende-identityserver-with-aspnet-core-identity) project template,
70+
and adds the necessary changes to support passkey authentication:
71+
72+
* In `HostingExtensions.cs`, the ASP.NET Identity schema is set to `IdentitySchemaVersions.Version3`.
73+
* An Entity Framework Core migration is added to generate the `AspNetUserPasskeys` table in the database.
74+
* The `Passkeys/PasskeyEndpointRouteBuilderExtensions.cs` file registers required minimal API endpoints for passkey creation and passkey request options. The extension method is called in `HostingExtensions.cs`.
75+
* The `Passkeys/PasskeyOperation.cs`, `Passkeys/PasskeySubmitTagHelper.cs` and `wwwroot/js/passkey-submit.js`files define a tag helper and web component to handle passkey creation and authentication.
76+
* `Pages/_ViewImports.cshtml` is updated to load the tag helper.
77+
* The `Models/PasskeyInputModel.cs` file is added and used in the `/Login/InputModel.cs` model.
78+
* The `Login/Index.cshtml` and `Login/Index.cshtml.cs` file include the necessary logic to handle passkey authentication.
79+
* The `Pages/Account/Passkeys.cshtml`, `Pages/Account/Passkeys.cshtml.cs`,`Pages/Account/RenamePasskey.cshtml`, and `Pages/Account/RenamePasskey.cshtml.cs` files add functionality to register a passkey credential and rename a passkey.
80+
81+
<LinkCard
82+
description="GitHub Repository for the ASP.NET Identity Passkey Sample"
83+
href="https://github.com/DuendeSoftware/samples/tree/main/IdentityServer/v7/AspNetIdentityPasskeys"
84+
title="ASP.NET Identity Passkey Sample"
85+
target="_blank"
5886
/>

0 commit comments

Comments
 (0)