From 46f365d6efaa59d822cda3a784cd91fe2053c8ae Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Thu, 30 Jun 2022 17:53:06 -0400 Subject: [PATCH] feat: expose credential parameter configuration (#40) --- webauthn/registration.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webauthn/registration.go b/webauthn/registration.go index 767b0e22..5b0c993c 100644 --- a/webauthn/registration.go +++ b/webauthn/registration.go @@ -97,6 +97,13 @@ func WithExtensions(extension protocol.AuthenticationExtensions) RegistrationOpt } } +// Provide credential parameters to registration options +func WithCredentialParameters(credentialParams []protocol.CredentialParameter) RegistrationOption { + return func(cco *protocol.PublicKeyCredentialCreationOptions) { + cco.Parameters = credentialParams + } +} + // WithAppIdExcludeExtension automatically includes the specified appid if the CredentialExcludeList contains a credential // with the type `fido-u2f`. func WithAppIdExcludeExtension(appid string) RegistrationOption {