我正在尝试在我的网站上设置 WebAuthn 身份验证流程,但遇到了问题。我希望我的用户能够在主网站 (www.domain.com) 上注册他们的设备,以便可以通过用户设置轻松访问。身份验证本身通过 IdP (sso.domain.com) 在不同的子域上进行。这就是麻烦开始的地方。
我尝试过以下几件事:
如果我正确理解规范,传递“scoutswechel.be”实际上应该有效,因为两个域都是主域的子域(如果我在这里错了,请纠正我)。
我使用 PHP 准备挑战,并通过 ajax 调用将它们传递到页面。我的 PHP 脚本返回以下值:
{
"publicKey":{
"challenge":[105,107,101,103,105,49,119,115,98,108,119,109,48,109,105,53],
"user":{
"name":"walter",
"displayName":"Wouter Henderickx",
"id":[49,48,51]
},
"rp":{
"id":"scoutswechel.be",
"name":"scoutswechel.be"
},
"pubKeyCredParams":[
{
"alg":-7,
"type":"public-key"
}
],
"authenticatorSelection":{
"authenticatorAttachment":"cross-platform",
"requireResidentKey":false,
"userVerification":"preferred"
},
"attestation":null,
"timeout":60000,
"excludeCredentials":[],
"extensions":{ …Run Code Online (Sandbox Code Playgroud)