首页 > 解决方案 > auth0 登录问题“我们很抱歉,尝试登录时出现问题。” 错误 403 无效状态

问题描述

在我使用Auth0.swift库的 iOS 应用程序上

我在尝试对用户进行身份验证时看到此错误。“很抱歉,尝试登录时出现问题。”</p>

应用程序以下列方式询问身份验证

Auth0
    .webAuth()
    .scope("openid profile email offline_access")
    .audience("https://api.xxx.xxx")
    .start

执行请求时调试 Safari 登录页面

Request 
:method: POST 
:scheme: https 
:authority: XXX.eu.auth0.com 
:path: /usernamepassword/login 
Content-Type: application/json 
Accept: / Host: XXX.eu.auth0.com 
Accept-Language: en-us 
Accept-Encoding: br, gzip, deflate 
Origin: https://XXX.eu.auth0.com 
Referer: https://XXX.eu.auth0.com/login?state=IqUcaKz8oL43BPVflsm84gUET1cDrnaN&client=XXXmyclientIDXXX&protocol=oauth2&response_type=code&redirect_uri=xxx.XXX%3A%2F%2FXXX.eu.auth0.com%2Fios%2Fxxx.XXX%2Fcallback&audience=https%3A%2F%2Fapi.XXX.xxx&code_challenge=U89LGQB5BSIi5ilLyQqSTVqjrqYDwn9O700SrC-70tk&code_challenge_method=S256&scope=openid%20profile%20email%20offline_access&auth0Client=xxx 
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1 DNT: 1 
Connection: keep-alive 
Content-Length: 722 
Auth0-Client: xxx

我看到以下错误响应

    { "statusCode": 403, 
"description": "Invalid state", 
"name": "AnomalyDetected", 
"code": "access_denied" }

不幸的是,我无法在我的调试环境中再重现它,但对于某些用户来说,该问题仍然存在于现场。我怀疑它可能与 iOS 12 更新有关。

标签: iosswiftauth0

解决方案


有错误name": "AnomalyDetected", "code": "access_denied"。您确定您没有打开异常检测并且从同一个 IP 进行了多次失败的登录尝试吗?


推荐阅读