-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[PM-4167] Add PRF attestation flow during passkey registration #3339
[PM-4167] Add PRF attestation flow during passkey registration #3339
Conversation
3ba6c73
to
4f0e15b
Compare
New Issues
Fixed Issues
|
696638e
to
083b342
Compare
083b342
to
6c31877
Compare
6c31877
to
5e589ae
Compare
src/Core/Services/IUserService.cs
Outdated
@@ -28,7 +28,7 @@ public interface IUserService | |||
Task<bool> DeleteWebAuthnKeyAsync(User user, int id); | |||
Task<bool> CompleteWebAuthRegistrationAsync(User user, int value, string name, AuthenticatorAttestationRawResponse attestationResponse); | |||
Task<CredentialCreateOptions> StartWebAuthnLoginRegistrationAsync(User user); | |||
Task<bool> CompleteWebAuthLoginRegistrationAsync(User user, string name, CredentialCreateOptions options, AuthenticatorAttestationRawResponse attestationResponse); | |||
Task<bool> CompleteWebAuthLoginRegistrationAsync(User user, string name, bool supportsPrf, string encryptedUserKey, string encryptedPublicKey, string encryptedPrivateKey, CredentialCreateOptions options, AuthenticatorAttestationRawResponse attestationResponse); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎨 Could these new parameters move to the end and be optional? For non-PRF default assumptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also consider making a data model for all these parameters and build it from the response model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! I'll look into the model approach in my refactor task, where I'll convert these functions to commands!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I'll wait to approve until @ike-kottlowski gets a chance as well 👍
if (SupportsPrf && EncryptedUserKey != null && EncryptedPrivateKey != null && EncryptedPublicKey != null) | ||
{ | ||
return WebAuthnPrfStatus.Enabled; | ||
} | ||
else if (SupportsPrf) | ||
{ | ||
return WebAuthnPrfStatus.Supported; | ||
} | ||
|
||
return WebAuthnPrfStatus.Unsupported; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit (non-blocking): just a tiny suggestion for readability
if (SupportsPrf && EncryptedUserKey != null && EncryptedPrivateKey != null && EncryptedPublicKey != null) | |
{ | |
return WebAuthnPrfStatus.Enabled; | |
} | |
else if (SupportsPrf) | |
{ | |
return WebAuthnPrfStatus.Supported; | |
} | |
return WebAuthnPrfStatus.Unsupported; | |
if (!SupportsPrf) | |
{ | |
return WebAuthnPrfStatus.Unsupported; | |
} | |
if (EncryptedUserKey != null && EncryptedPrivateKey != null && EncryptedPublicKey != null) | |
{ | |
return WebAuthnPrfStatus.Enabled; | |
} | |
return WebAuthnPrfStatus.Supported; | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
src/Core/Services/IUserService.cs
Outdated
@@ -28,7 +28,7 @@ public interface IUserService | |||
Task<bool> DeleteWebAuthnKeyAsync(User user, int id); | |||
Task<bool> CompleteWebAuthRegistrationAsync(User user, int value, string name, AuthenticatorAttestationRawResponse attestationResponse); | |||
Task<CredentialCreateOptions> StartWebAuthnLoginRegistrationAsync(User user); | |||
Task<bool> CompleteWebAuthLoginRegistrationAsync(User user, string name, CredentialCreateOptions options, AuthenticatorAttestationRawResponse attestationResponse); | |||
Task<bool> CompleteWebAuthLoginRegistrationAsync(User user, string name, bool supportsPrf, string encryptedUserKey, string encryptedPublicKey, string encryptedPrivateKey, CredentialCreateOptions options, AuthenticatorAttestationRawResponse attestationResponse); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also consider making a data model for all these parameters and build it from the response model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. No notes.
Type of change
Objective
Allow users to create and register all necessary keys to allow vault decryption using a passkey
Before you submit
dotnet format --verify-no-changes
) (required)