我正在尝试通过本机 Mac 应用程序向 Google OAuth 2 进行身份验证。我在 Google Developer Console 中将我的应用程序设置为Desktop
应用程序,但无处指定redirect_uri
. 据我了解,这些仅适用于 Web 应用程序。
但是在使用 Swift 编写我的请求时ASWebAuthenticationSession
,我得到的身份验证 URL 是这样的(为易读添加了换行符):
https://accounts.google.com/o/oauth2/v2/auth?
client_id=******.apps.googleusercontent.com&
response_type=code&
redirect_uri=pro.cova%3A%2F&
scope=profile%2520email%2520https%3A%2F%2Fmail.google.com%2F&flowName=GeneralOAuthFlow
我的应用的自定义 URL 类型是pro.cova:/
.
我从 Google 收到此错误:
Error 400: redirect_uri_mismatch
如果 Google Developer Console 中没有指定不匹配,可能会发生什么不匹配?