gpt4 book ai didi

php - Google 登录 (iOS) 使用后端服务器进行身份验证无效的颁发者错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:13:20 26 4
gpt4 key购买 nike

您好,当我使用 google php API 验证服务器中的 token ID 时,我遇到了无效发行者错误r。 token 是从 iOS 谷歌登录中检索的,在 http 发布请求中传递给服务器。

验证 token 的PHP代码

$client->verifyIdToken($token)

错误返回但有用户凭据

Invalid issuer, https:\/\/accounts.google.com != accounts.google.com: {\"iss\":\"https:\/\/accounts.google.com\",\"at_hash\":\"ZYZ\",\"aud\":\"apps.googleusercontent.com\",\"sub\":\"XYZ\",\"email_verified\":true,\"azp\":\"XYZ\",\"email\":\"ZYP\",\"iat\":1449542280,\"exp\":1449545880}

我按照谷歌开发人员的说明

https://developers.google.com/identity/sign-in/ios/backend-auth

https://developers.google.com/api-client-library/php/guide/aaa_idtoken

最佳答案

好的,找到问题了。对于将来可能遇到此类问题的人,请不要使用 google php api 文档中所述的版本 1.0.*@beta。使用 1.1.* 或更高版本

"require": {
"google/apiclient": "1.1.*"
}

在git repo 中发现这个问题在1.0 版本之后被修复

关于php - Google 登录 (iOS) 使用后端服务器进行身份验证无效的颁发者错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34147348/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com