英文:
webauthn example indicates browser is not supported when cross compiled but works on host machine
问题
我正在测试一个使用Go编写的非常简单的WebAuthn示例,来源于https://github.com/hbolimovsky/webauthn-example,当我在主机上构建它时,它运行得很好。我正在使用MacOS Big Sur和Chrome 91。然而,如果我将示例构建为arm7/linux机器,我会收到“浏览器不受支持”的错误消息。
显然,浏览器是受支持的,因为它在主机上运行正常。检查浏览器支持的代码如下:
// 检查当前浏览器是否支持WebAuthn
if (!window.PublicKeyCredential) {
alert("错误:该浏览器不支持WebAuthn");
return;
}
交叉编译的机器没有互联网访问权限,尽管我非常怀疑这是原因。这可能是什么原因呢?
我通过它的IP地址访问交叉编译的机器。这可能是原因吗?为了测试这一点,我通过它的Bonjour名称访问它,但没有任何区别。
英文:
I am testing a very simple webauthn example written with go from https://github.com/hbolimovsky/webauthn-example and it works very well when I build it for the host machine. I am using MacOS Big Sur with Chrome 91. However, if I build the example for an arm7/linux machine, I am getting "browser not supported" error message.
Clearly the browser is supported since it works on the host machine. The code that checks for browser support is this
// check whether current browser supports WebAuthn
if (!window.PublicKeyCredential) {
alert("Error: this browser does not support WebAuthn");
return;
}
The cross compiled machine doesn't have internet access though I am highly doubtful that that is the reason. What can be the reason for this?
I am accessing the cross compiled machine through it's IP address. Can that be the reason? To test this I accessed it through it's bonjour name and that didn't make a difference.
答案1
得分: 5
你如何通过浏览器访问你的 Linux/ARM 机器?WebAuthn 只在安全环境下工作,比如 http://localhost 或 https://anywhereelse...
英文:
How do you access your linux/arm machine with your browser? WebAuthn only works in a secure context, http://localhost or https://anywhereelse that is...
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论