首页 > 解决方案 > 使用 Auth0 运行我的 WeGL Unity 游戏的构建时出错

问题描述

我正在尝试将我的统一网络游戏与 auth0 连接起来。我们的想法是在这个游戏上设置一个按钮,将您重定向到 auth0 登录页面。如果登录正确,登录会将您重定向到游戏页面。

问题是,每当我尝试这样做时,它都会引发如下错误:

    Uncaught abort(59) at Error
at jsStackTrace (blob:http://localhost/fe45a070-7884-4685-9ce7-c8c6586954fe:8:22295)
at Object.stackTrace (blob:http://localhost/fe45a070-7884-4685-9ce7-c8c6586954fe:8:22466)
at Object.onAbort (http://localhost/Proyecto/Build/UnityLoader.js:4:11047)
at abort (blob:http://localhost/fe45a070-7884-4685-9ce7-c8c6586954fe:8:484763)
at wasm-function[56209]:3
at wasm-function[16669]:46
at wasm-function[46796]:1456
at wasm-function[56098]:16
at Object.dynCall_iii (blob:http://localhost/fe45a070-7884-4685-9ce7-c8c6586954fe:8:459875)
at invoke_iii (blob:http://localhost/fe45a070-7884-4685-9ce7-c8c6586954fe:8:339724)
at wasm-function[46793]:388
at wasm-function[46792]:75
at wasm-function[46790]:99
at wasm-function[46789]:7
at wasm-function[47108]:69
at wasm-function[47107]:7
at wasm-function[18228]:330
at wasm-function[16690]:48
at wasm-function[17191]:1236
at wasm-function[16690]:48
at wasm-function[17240]:1090
at wasm-function[17854]:534
at wasm-function[50883]:330
at wasm-function[17181]:101
at wasm-function[16866]:152
at wasm-function[18035]:71
at wasm-function[18034]:128
at wasm-function[17061]:1169
at wasm-function[16689]:52
at wasm-function[16868]:11
at wasm-function[56136]:22
at Object.dynCall_viiiii (blob:http://localhost/fe45a070-7884-4685-9ce7-c8c6586954fe:8:476660)
at invoke_viiiii (blob:http://localhost/fe45a070-7884-4685-9ce7-c8c6586954fe:8:371147)
at wasm-function[16990]:230
at wasm-function[16988]:97
at wasm-function[16987]:83
at wasm-function[16986]:81
at wasm-function[24829]:513
at wasm-function[24828]:42
at wasm-function[24827]:93
at wasm-function[25055]:77
at wasm-function[55719]:83
at wasm-function[24386]:314
at wasm-function[48387]:21
at wasm-function[48411]:110
at wasm-function[38808]:79
at wasm-function[38809]:14
at wasm-function[17204]:152
at wasm-function[38636]:101
at wasm-function[17316]:153

这是我用来连接 Unity 和 Auth0 的代码:

    public void test()
{
    var client = new AuthenticationApiClient(new System.Uri("...."));

    var authorizationUrl = client.BuildAuthorizationUrl()
        .WithResponseType(AuthorizationResponseType.IdToken, AuthorizationResponseType.Token)
        .WithClient("...")            
        .WithConnection("...")
        .WithRedirectUrl("....")            
        .Build();

}

我是 Unity 和 Auth0 的新手。关于可能发生的事情有什么建议吗?

标签: c#unity3dauth0

解决方案


虽然我不确定 Unity 方面,但我知道您可以利用通用登录来完成您正在寻找的内容。我建议对您的回调 URL 进行三次检查,以确保在您的应用程序和 Auth0 仪表板中没有故障。


推荐阅读