【发布时间】:2022-11-10 04:57:17
【问题描述】:
我正在尝试将 Azure B2C 添加为 Firebase 身份验证的 OIDC 提供程序。隐式流程工作正常,但代码流程失败并出现以下任一错误:
Malformed response cannot be parsed from oidc.<provider_name> for CODE_EXCHANGE
或者
Invalid OAuth response from oidc.<provider_name>
经过调查,我发现发生此故障的最后一次调用是:
curl --location --request POST 'https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyAssertion?key=<web_key>' \
--header 'Content-Type: text/plain' \
--data-raw '{
"returnSecureToken" : true,
"requestUri" : "https://<firebase_project_name>.firebaseapp.com/__/auth/handler?state=<state_goes_here>&code=<authcode_flow_code>",
"postBody" : "providerId=oidc.<provider_name>",
"sessionId" : "<random_session_id>",
"autoCreate" : true,
"returnIdpCredential" : true
}'
此请求的响应如下:
{
"error": {
"code": 400,
"message": "INVALID_IDP_RESPONSE : Invalid OAuth response from oidc.<provider_name>",
"errors": [
{
"message": "INVALID_IDP_RESPONSE : Invalid OAuth response from oidc.<provider_name>",
"domain": "global",
"reason": "invalid"
}
]
}
}
我尝试检查 Firebase 日志,但没有可用的有用信息。但是,我确实注意到 Firebase 在失败并返回 400 错误之前成功地从 Azure B2C 将此代码交换为 id_token。
在这方面有什么帮助吗?
【问题讨论】:
标签: firebase-authentication openid-connect azure-b2c