-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Support signaling unknown passkey credentials #68513
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
Open
rolandVi
wants to merge
9
commits into
dotnet:rolandVi/passkey-work
Choose a base branch
from
rolandVi:passkeys/signal-unknown-credential
base: rolandVi/passkey-work
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
365b26e
Add WebAuthn Signal API support for passkeys
rolandVi 8beab7a
Apply suggestions from code review
rolandVi ac4227b
Move passkey signal options to IPasskeyHandler
rolandVi 0f8b457
Pipeline fix - Add missing System.Buffers.Text using to BlazorTemplat…
rolandVi 1a1db26
Merge branch 'rolandVi/passkey-work' into roland/passkey-signals
rolandVi de393b0
Rename known passkeys signal APIs
rolandVi 8b66778
Merge branch 'roland/passkey-signals' of https://github.com/rolandVi/…
rolandVi 193a69a
Support signaling unknown passkey credentials
rolandVi ea48294
Apply suggestions from code review
rolandVi 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace Microsoft.AspNetCore.Identity; | ||
|
|
||
| /// <summary> | ||
| /// Represents the result of a known passkeys signal options generation. | ||
| /// </summary> | ||
| public sealed class KnownPasskeysSignalOptionsResult | ||
| { | ||
| /// <summary> | ||
| /// Gets or sets the JSON representation of the known passkeys signal options. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// The structure of this JSON is a superset of the options accepted by the | ||
| /// <c>PublicKeyCredential.signalAllAcceptedCredentials()</c> and | ||
| /// <c>PublicKeyCredential.signalCurrentUserDetails()</c> JavaScript APIs. | ||
| /// See <see href="https://www.w3.org/TR/webauthn-3/#sctn-signal-methods"/>. | ||
| /// </remarks> | ||
| public required string SignalOptionsJson { get; init; } | ||
| } |
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
40 changes: 40 additions & 0 deletions
40
src/Identity/Core/src/Passkeys/KnownPasskeysSignalOptions.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,40 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace Microsoft.AspNetCore.Identity; | ||
|
|
||
| /// <summary> | ||
| /// Represents the information needed to signal the current state of a user's known passkeys to authenticators. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// This is a superset of the options accepted by the WebAuthn <c>signalAllAcceptedCredentials</c> | ||
| /// and <c>signalCurrentUserDetails</c> methods. | ||
| /// See <see href="https://www.w3.org/TR/webauthn-3/#sctn-signal-methods"/>. | ||
| /// </remarks> | ||
| internal sealed class KnownPasskeysSignalOptions | ||
| { | ||
| /// <summary> | ||
| /// Gets the relying party identifier. | ||
| /// </summary> | ||
| public required string RpId { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the user handle of the user that owns the credentials. | ||
| /// </summary> | ||
| public required BufferSource UserId { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the credential IDs that are currently registered for the user. | ||
| /// </summary> | ||
| public required IReadOnlyList<BufferSource> AllAcceptedCredentialIds { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the name of the user. | ||
| /// </summary> | ||
| public required string Name { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the display name of the user. | ||
| /// </summary> | ||
| public required string DisplayName { get; init; } | ||
| } |
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,15 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace Microsoft.AspNetCore.Identity; | ||
|
|
||
| /// <summary> | ||
| /// Represents the credential ID from a public key credential. | ||
| /// </summary> | ||
| internal sealed class PublicKeyCredentialId | ||
| { | ||
| /// <summary> | ||
| /// Gets the credential ID. | ||
| /// </summary> | ||
| public required BufferSource Id { get; init; } | ||
| } |
24 changes: 24 additions & 0 deletions
24
src/Identity/Core/src/Passkeys/UnknownPasskeySignalOptions.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,24 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace Microsoft.AspNetCore.Identity; | ||
|
|
||
| /// <summary> | ||
| /// Represents the information needed to signal that a passkey is unknown to the server. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// These options are accepted by the WebAuthn <c>signalUnknownCredential</c> method. | ||
| /// See <see href="https://www.w3.org/TR/webauthn-3/#sctn-signal-methods"/>. | ||
| /// </remarks> | ||
| internal sealed class UnknownPasskeySignalOptions | ||
| { | ||
| /// <summary> | ||
| /// Gets the relying party identifier. | ||
| /// </summary> | ||
| public required string RpId { get; init; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the credential ID that is unknown to the server. | ||
| /// </summary> | ||
| public required BufferSource CredentialId { get; init; } | ||
| } |
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
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.