Auth0 checkSession 调用更新 return 一个 HTML 错误页面
Auth0 checkSession call to renew return an HTML error page
我有一个使用 Auth0 Implicit Flow with Silent Authentication. I got the authentication part working just fine, but when I try to implement checkSession
method to renew the session in the background (as per https://auth0.com/docs/libraries/auth0js/v9#using-checksession-to-acquire-new-tokens) 的单页应用程序,AJAX 调用 auth0.com 域 returns a 400 HTML 错误而不是 JSON 错误。
webAuth.checkSession({}, function (err, authResult) {
...
});
错误是 Oops!, something went wrong
,我可以在我的浏览器 devtools 网络响应选项卡中看到它。
There could be a misconfiguration in the system or a service outage. We track these errors automatically, but if the problem persists feel free to contact us.
Please try again.
我不确定为什么会有 HTML 响应,也不确定我可能做错了什么。我已将我的页面域添加到 Auth0 应用程序设置的 "Allowed Web Origins" 列表中。
我缺少的是为 checkSession
调用提供 redirectUri
参数。
我还发现我可以通过转到 Auth0 仪表板上的 "Logs" 菜单找到这些错误的日志。
我有一个使用 Auth0 Implicit Flow with Silent Authentication. I got the authentication part working just fine, but when I try to implement checkSession
method to renew the session in the background (as per https://auth0.com/docs/libraries/auth0js/v9#using-checksession-to-acquire-new-tokens) 的单页应用程序,AJAX 调用 auth0.com 域 returns a 400 HTML 错误而不是 JSON 错误。
webAuth.checkSession({}, function (err, authResult) {
...
});
错误是 Oops!, something went wrong
,我可以在我的浏览器 devtools 网络响应选项卡中看到它。
There could be a misconfiguration in the system or a service outage. We track these errors automatically, but if the problem persists feel free to contact us. Please try again.
我不确定为什么会有 HTML 响应,也不确定我可能做错了什么。我已将我的页面域添加到 Auth0 应用程序设置的 "Allowed Web Origins" 列表中。
我缺少的是为 checkSession
调用提供 redirectUri
参数。
我还发现我可以通过转到 Auth0 仪表板上的 "Logs" 菜单找到这些错误的日志。