Skip to content

Commit 0f0e324

Browse files
docs(README): explain different uses of cross origin
1 parent 49b642e commit 0f0e324

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,27 @@ WebAuthn.configure do |config|
107107
# When operating within iframes or embedded contexts, you may need to restrict
108108
# which top-level origins are permitted to host WebAuthn ceremonies.
109109
#
110-
# To enable this check, set the following configuration (disabled by default):
111-
# config.verify_cross_origin = false
110+
# crossOrigin / topOrigin verification is DISABLED by default:
111+
# config.verify_cross_origin = false
112112
#
113-
# Each entry in this list must match the `topOrigin` reported by the browser
114-
# during registration and authentication.
113+
# When `verify_cross_origin` is false, any `crossOrigin` / `topOrigin` values reported by the browser
114+
# are ignored. As a result, credentials created or used within a cross-origin iframe will be treated
115+
# as valid.
115116
#
116-
# config.allowed_top_origins = ["https://app.example.com"]
117+
# When `verify_cross_origin` is true, you can either:
118+
#
119+
# (A) Allow only specific top-level origins to embed your ceremony
120+
# (each entry must match the browser-reported `topOrigin` during registration/authentication):
121+
#
122+
# config.allowed_top_origins = ["https://app.example.com"]
123+
#
124+
# (B) Forbid ANY cross-origin iframe usage altogether
125+
# (this rejects creation/authentication whenever `crossOrigin` is true):
126+
#
127+
# config.allowed_top_origins = []
128+
#
129+
# Note: if `verify_cross_origin` is not enabled, any values set in `allowed_top_origins`
130+
# will be ignored.
117131

118132
# Relying Party name for display purposes
119133
config.rp_name = "Example Inc."

0 commit comments

Comments
 (0)