oauth - How do I implement Google sign-in on iOS app?
问题描述
I've been tasked with adding a "Sign In with Google" button to an iOS app. For background, I'm a contract developer doing work for a customer, and I do not own the app in question.
I did a quick search for how to do this, but the only answer I could find involved "set up a project in the Google API console" followed by "add a GIDSignInButton to your layout".
I do not have access to the app owner's Google Developer account (or know if they even have one), and I certainly do not want to "set up a project" in my own Google account that is associated with a customer's app.
Furthermore, the iOS project I'm working with does not currently have any third-party library integrations (no Swift packages, no CocoaPods, no workspace file) and I strongly prefer to keep it this way.
Is it possible to do Google authentication using a standard OAuth process (i.e. open a web page, and handle the redirect after authentication completes)? I have done other OAuth integrations this way so I know how it works.
Thanks, Frank
解决方案
是的,您可以使用 OAuth 登录,而无需使用 SDK。以下是说明。
您将需要设置一个项目并配置它的 OAuth 设置。这将管理您的应用在用户面前的显示方式并实施 OAuth 安全控制。没有办法解决这个问题,因此您需要与您的 Google Cloud 管理员合作以获得对现有项目的访问权限或创建一个新项目。
推荐阅读
- git - 合并/重新设置一个文件冲突的提交,接受上游,不能添加和继续,不能跳过,否则我会丢失新添加的文件
- python - 我正在尝试将包含字符串的变量(例如“allure.serverity_level.CRITICAL”)传递给符号@allure.severity()
- python - ThreadPoolExecutor 键盘中断
- javascript - Chrome 或 Firefox 中的 Web 开发人员模式:如何获取对象的 CSS 完整选择器?
- javascript - 未捕获的 ReferenceError:图表未在 test.html:11 中定义
- php - 如何从数据库中获取数据并映射到反应?
- javascript - 修改 svg 路径以删除填充部分
- amazon-web-services - 使用 AWS API Gateway 映射 URL 查询字符串参数
- c++ - strcpy克隆函数的C++代码问题
- c# - NuGet - 在构建时获取最新的 lib 版本