Skip to content

Commit b48108d

Browse files
fix docs: update deprecated origin and verify_registration usage (#470)
* docs: fix deprecated origin with allowed_origins * docs: fix verify_registration to use session[:creation_challenge]
2 parents b274e12 + 5c78886 commit b48108d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

docs/advanced_configuration.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ Instead of the [Global Configuration](../README.md#configuration) you place in `
2121
relying_party = WebAuthn::RelyingParty.new(
2222
# This value needs to match `window.location.origin` evaluated by
2323
# the User Agent during registration and authentication ceremonies.
24-
origin: "https://admin.example.com",
24+
# Multiple origins can be used when needed. Using more than one will imply you MUST configure rp_id explicitely. If you need your credentials to be bound to a single origin but you have more than one tenant, please see [our Advanced Configuration section](https://github.com/cedarcode/webauthn-ruby/blob/master/docs/advanced_configuration.md) instead of adding multiple origins.
25+
allowed_origins: ["https://admin.example.com"],
2526

2627
# Relying Party name for display purposes
2728
name: "Admin Site for Example Inc."
@@ -101,7 +102,7 @@ session[:creation_challenge] = options.challenge
101102
begin
102103
webauthn_credential = relying_party.verify_registration(
103104
params[:publicKeyCredential],
104-
params[:create_challenge]
105+
session[:creation_challenge]
105106
)
106107

107108
# Store Credential ID, Credential Public Key and Sign Count for future authentications

0 commit comments

Comments
 (0)