Skip to content

Add support for hints in credential options - #513

Merged
santiagorodriguez96 merged 2 commits into
masterfrom
sr--add-hints-option
Oct 22, 2026
Merged

santiagorodriguez96 merged 2 commits into
masterfrom
sr--add-hints-option

Conversation

@santiagorodriguez96

@santiagorodriguez96 santiagorodriguez96 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

WebAuthn Level 3 adds a hints member to both PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions, which lets a Relying Party guide the client's UI toward the kind of authenticator it expects. Values come from PublicKeyCredentialHint: "security-key", "client-device", "hybrid".

The gem doesn't support it, and it can't be passed through either:

WebAuthn::Credential.options_for_create(user: { id: WebAuthn.generate_user_id, name: "user" }, hints: ["client-device"])
# => ArgumentError: unknown keyword: :hints

Details

This PR adds support to PublicKeyCredential::CreationOptions and PublicKeyCredential::RequestOptions to receive hints. hints default it to nil and are included when the options are serialized to JSON.

@santiagorodriguez96
santiagorodriguez96 merged commit 66512c8 into master Oct 22, 2026
49 checks passed
@santiagorodriguez96
santiagorodriguez96 deleted the sr--add-hints-option branch October 22, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants