-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Add passkeys to ASP.NET Core Identity #62112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+7,186
−185
Merged
Changes from 4 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
01104ac
Initial commit
MackinnonBuck 8294e9e
Remove extra entry in Version.Details.xml
MackinnonBuck 725a304
Fix Program.Main.cs
MackinnonBuck f86515f
Fix failing tests
MackinnonBuck f828930
Merge remote-tracking branch 'origin/main' into mbuck/passkeys
MackinnonBuck ee5e007
Add passkey sample app + E2E tests
MackinnonBuck e23320c
Correctly specify transports in generated credential options
MackinnonBuck 32d3f5f
Merge branch 'main' into mbuck/passkeys
MackinnonBuck b07c980
Merge branch 'main' into mbuck/passkeys
MackinnonBuck 5d3b864
Undo changes to Components.slnf
MackinnonBuck af27faf
Move core passkey implementation to Microsoft.AspNetCore.Identity
MackinnonBuck 65e6a37
Update Passkeys.razor
MackinnonBuck bb187c7
PR feedback
MackinnonBuck d178068
Update template passkey functionality
MackinnonBuck 331b5f6
PR feedback
MackinnonBuck beecc32
PR feedback
MackinnonBuck 2636c5e
Remove PasskeyRequestContext
MackinnonBuck ce0f0b1
API cleanups
MackinnonBuck d2cb5f5
Merge branch 'main' into mbuck/passkeys
MackinnonBuck 7f63102
Try to fix CI
MackinnonBuck 4711627
Merge branch 'mbuck/passkeys' of https://github.com/dotnet/aspnetcore…
MackinnonBuck 8ee6b19
Update Versions.props
MackinnonBuck e82ddcb
Update Directory.Build.targets.in
MackinnonBuck b114f44
Better exceptions + clean up JSON representation
MackinnonBuck c11365d
Merge branch 'main' into mbuck/passkeys
MackinnonBuck 03d8a62
PR feedback
MackinnonBuck cabe3ee
PR feedback
MackinnonBuck 75fa369
Merge branch 'main' into mbuck/passkeys
MackinnonBuck 927596b
Update template
MackinnonBuck c232673
PR feedback
MackinnonBuck f5d78e2
PR feedback
MackinnonBuck e7ccd11
Update baselines
MackinnonBuck 5a91bbe
Merge branch 'main' into mbuck/passkeys
MackinnonBuck ac1bd58
PR feedback + a few tests
MackinnonBuck 9c23ecd
Merge branch 'mbuck/passkeys' of https://github.com/dotnet/aspnetcore…
MackinnonBuck 231cc6f
Add BOM to template files
MackinnonBuck 29c008d
Add passkey autofill
MackinnonBuck 8f16a1a
Fix E2E tests
MackinnonBuck 7aa5a11
Merge branch 'main' into mbuck/passkeys
MackinnonBuck 4964087
Cleanups
MackinnonBuck 130fa9b
Update SignInManager.cs
MackinnonBuck c528deb
Merge branch 'main' into mbuck/passkeys
MackinnonBuck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,4 @@ | |
"src\\Components\\test\\testassets\\TestContentPackage\\TestContentPackage.csproj" | ||
] | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/Identity/Core/src/HttpPasskeyRequestContextProvider.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.Extensions.Options; | ||
|
||
namespace Microsoft.AspNetCore.Identity; | ||
|
||
internal sealed class HttpPasskeyRequestContextProvider(IHttpContextAccessor httpContextAccessor, IOptions<IdentityOptions> options) : IPasskeyRequestContextProvider | ||
{ | ||
private PasskeyRequestContext? _context; | ||
|
||
public PasskeyRequestContext Context => _context ??= GetPasskeyRequestContext(); | ||
|
||
private PasskeyRequestContext GetPasskeyRequestContext() | ||
{ | ||
var passkeyOptions = options.Value.Passkey; | ||
var httpContext = httpContextAccessor.HttpContext; | ||
return new() | ||
{ | ||
Domain = passkeyOptions.ServerDomain ?? httpContext?.Request.Host.Host, | ||
Origin = httpContext?.Request.Headers.Origin, | ||
}; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
#nullable enable | ||
virtual Microsoft.AspNetCore.Identity.SignInManager<TUser>.ConfigurePasskeyCreationOptionsAsync(Microsoft.AspNetCore.Identity.PasskeyCreationArgs! creationArgs) -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.PasskeyCreationOptions!>! | ||
virtual Microsoft.AspNetCore.Identity.SignInManager<TUser>.ConfigurePasskeyRequestOptionsAsync(Microsoft.AspNetCore.Identity.PasskeyRequestArgs<TUser!>! requestArgs) -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.PasskeyRequestOptions!>! | ||
virtual Microsoft.AspNetCore.Identity.SignInManager<TUser>.PasskeySignInAsync(string! credentialJson, Microsoft.AspNetCore.Identity.PasskeyRequestOptions! options) -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.SignInResult!>! | ||
virtual Microsoft.AspNetCore.Identity.SignInManager<TUser>.RetrievePasskeyCreationOptionsAsync() -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.PasskeyCreationOptions?>! | ||
virtual Microsoft.AspNetCore.Identity.SignInManager<TUser>.RetrievePasskeyRequestOptionsAsync() -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.PasskeyRequestOptions?>! |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.