ios - “client_secret 丢失。” 在 iOS 中 Google 登录
问题描述
我正在尝试将 Google OAuth2 集成到我的 Swift 应用程序中。
按照本指南,我可以安装库并添加按钮。谷歌登录提示打开,但是当我登录时请求失败并显示 400:
Error data:
{
error = "invalid_request";
"error_description" = "client_secret is missing.";
}
这是我的视图代表:
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// …
// Initialize sign-in
GIDSignIn.sharedInstance().clientID = "(xxx).apps.googleusercontent.com"
GIDSignIn.sharedInstance().delegate = self
return true
}
我不知道如何设置秘密,文档中没有提到它?
解决方案
推荐阅读
- c# - 如何从泛型类型定义中获取类型参数名称?
- google-apps-script - 在 Google Classroom API 中自动分配下一个作业
- tomcat - tomcat 脚本没有以与 catalina.bat 和 service.bat 相同的方式处理 Java 环境变量?
- json - JSON中的位数据类型
- python-3.x - 在保留对全局变量所做的更改时需要帮助
- java - 带有泛型的 Java 继承扩展
- javascript - Pushover javascript - 发送消息问题
- python - rfile.read() 是如何工作的?
- javascript - 如何在模式中提交按钮时重新加载页面
- python - Python:编辑 CSV 文件 - 加入两行并更改列名