Skip to content

Commit e23320c

Browse files
committed
Correctly specify transports in generated credential options
1 parent ee5e007 commit e23320c

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/Identity/Extensions.Core/src/UserManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,7 +2252,7 @@ async Task<PublicKeyCredentialDescriptor[]> GetExcludeCredentialsAsync()
22522252
var excludeCredentials = passkeys
22532253
.Select(p => new PublicKeyCredentialDescriptor(type: "public-key", id: BufferSource.FromBytes(p.CredentialId))
22542254
{
2255-
Transports = [] // TODO: Consider making this configurable.
2255+
Transports = p.Transports ?? [],
22562256
});
22572257
return [.. excludeCredentials];
22582258
}
@@ -2305,7 +2305,7 @@ async Task<PublicKeyCredentialDescriptor[]> GetAllowCredentialsAsync()
23052305
var allowCredentials = passkeys
23062306
.Select(p => new PublicKeyCredentialDescriptor(type: "public-key", id: BufferSource.FromBytes(p.CredentialId))
23072307
{
2308-
Transports = [] // TODO: Consider making this configurable.
2308+
Transports = p.Transports ?? [],
23092309
});
23102310
return [.. allowCredentials];
23112311
}

src/Identity/samples/IdentitySample.PasskeyUI/Components/Pages/Home.razor

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@
1111

1212
<h1>Welcome!</h1>
1313

14+
<p>
15+
This app demonstrates how to use passkeys for authentication with ASP.NET Core Identity.
16+
</p>
17+
18+
<p>
19+
See <a href="https://learn.microsoft.com/microsoft-edge/devtools-guide-chromium/webauthn/" target="_blank">these docs</a>
20+
to learn how to simplify passkey testing with a virtual authenticator.
21+
</p>
22+
23+
<p>
24+
<b>NOTE:</b> For simplicity, users are stored in memory, so passkeys will be lost when the app restarts.
25+
</p>
26+
1427
<h3>Log in or register here</h3>
1528

1629
<form id="auth-form" method="post" @formname="auth" @onsubmit="OnSubmitAsync">

0 commit comments

Comments
 (0)