Skip to content

Commit 2718d44

Browse files
authored
Add CredentialPropertiesOuput (RK Support) (#411)
* Add CredentialPropertiesOutput * Use .ID instead of null CredentialId
1 parent 906c238 commit 2718d44

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

Demo/Controller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public async Task<JsonResult> MakeCredential([FromBody] AuthenticatorAttestation
121121
{
122122
Type = success.Result.Type,
123123
Id = success.Result.Id,
124-
Descriptor = new PublicKeyCredentialDescriptor(success.Result.CredentialId),
124+
Descriptor = new PublicKeyCredentialDescriptor(success.Result.Id),
125125
PublicKey = success.Result.PublicKey,
126126
UserHandle = success.Result.User.Id,
127127
SignCount = success.Result.Counter,

Src/Fido2.Models/Objects/AuthenticationExtensionsClientOutputs.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class AuthenticationExtensionsClientOutputs
5656
/// </summary>
5757
[JsonPropertyName("credProps")]
5858
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
59-
public bool? CredProps { get; set; }
59+
public CredentialPropertiesOutput? CredProps { get; set; }
6060

6161
/// <summary>
6262
/// This extension allows a Relying Party to evaluate outputs from a pseudo-random function (PRF) associated with a credential.
@@ -65,4 +65,4 @@ public class AuthenticationExtensionsClientOutputs
6565
[JsonPropertyName("prf")]
6666
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
6767
public AuthenticationExtensionsPRFOutputs? PRF { get; set; }
68-
}
68+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#nullable enable
2+
using System.Text.Json.Serialization;
3+
4+
namespace Fido2NetLib.Objects;
5+
6+
/// <summary>
7+
/// This client registration extension facilitates reporting certain credential properties known by the client to the requesting WebAuthn Relying Party upon creation of a public key credential source as a result of a registration ceremony.
8+
/// </summary>
9+
public class CredentialPropertiesOutput
10+
{
11+
/// <summary>
12+
/// This OPTIONAL property, known abstractly as the resident key credential property (i.e., client-side discoverable credential property), is a Boolean value indicating whether the PublicKeyCredential returned as a result of a registration ceremony is a client-side discoverable credential. If rk is true, the credential is a discoverable credential. if rk is false, the credential is a server-side credential. If rk is not present, it is not known whether the credential is a discoverable credential or a server-side credential.
13+
/// </summary>
14+
[JsonPropertyName("rk")]
15+
public bool Rk { get; set; }
16+
}

0 commit comments

Comments
 (0)