sách gpt4 ai đã đi

oauth - token 返回后,Google 和帐户关联失败的操作

In lại 作者:行者123 更新时间:2023-12-03 22:22:24 27 4
mua khóa gpt4 Nike

尝试使用 OAuth2 授权代码流程在 Web 模拟器中测试身份验证,https://developers.google.com/actions/tools/web-simulator

参见:https://developers.google.com/actions/tools/testing#testing_account_linking_with_google_home_web_simulator

并且: https://developers.google.com/actions/develop/identity/oauth2-code-flow

如果您已将操作设置为需要授权服务的授权,则当您尝试访问操作时,助理会建议您需要链接您的帐户。在同一响应中,模拟器提供了用于启动链接过程的 URL,请参阅:

"debugInfo": {
"sharedDebugInfo": [
{
"name": "Account Linking Url",
"debugInfo": "https://assistant.google.com/services/auth/handoffs/auth/start?provider=your-google-project-id_dev&scopes=your-scopes&return_url=https://www.google.com/"
}
]
}

调用此 URL(粘贴到浏览器中)将引导您完成 OAuth2 流程,假设所需的用户操作成功,Google 将使用流程期间提供的授权代码调用您的 token 端点。

但后来我得到:

result_code=FAILURE&result_message=Account+linking+failed

从我这边看来一切都正常,但 Google 返回了失败。

1 Câu trả lời

就我而言,我的 token 端点返回了标准 token 响应对象,其中包括 access_token,refresh_token,expires_in, session_state 和另一个 token ,该 token 不需要用于此目的,但对于我的 token 响应来说是标准的。

当我在 Google Playground 上测试相同的响应时,效果很好: https://developers.google.com/oauthplayground/

但使用助手 URL 时则不然: https://assistant.google.com/services/auth/handoffs/auth/start?provider=your-google-project-id_dev&scopes=your-scopes&return_url=https://www.google.com/

事实证明,助手不喜欢响应对象中多余的属性。

我还没有完全确定什么是允许的,什么是不允许的,但到目前为止你可以:

{
"token_type": "Bearer",
"access_token: "xxx",
"refresh_token": "yyy",
"expires_in": "zzz"
}

有了这些,我现在得到:

result_code=SUCCESS

关于oauth - token 返回后,Google 和帐户关联失败的操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43113595/

27 4 0
Bài viết được đề xuất: meteor - 从外部应用程序验证 meteor 用户
Bài viết được đề xuất: angularjs - 范围问题中的 Angular 绑定(bind)模型?
Bài viết được đề xuất: Thư viện/công cụ nén PDF
Bài viết được đề xuất: google-bigquery - 计费层级超出预期范围
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com