我无法在 ios 上授权 Google OAuth,safari 总是说
400 这是一个错误。
redirect_uri 的参数值无效:缺少方案:com.googleusercontent.apps.984813079630-3lmlrubo9345ng4qhtf62ud1i02m6ta8
我在 Google 控制台页面上多次检查了 API Key、Client_ID、client_secret,还在 xcode 中创建了 url 方案。
这是我的 Swift 代码:
oauthswift = OAuth2Swift(consumerKey: "xxxxx-3lmlrubo9345ng4qhtf62ud1i02m6ta8.apps.googleusercontent.com", consumerSecret: "xxxtg6qslUOC2np1sBg0hnWgBcpZb4", authorizeUrl: " https ://google.comauthv/google.comauthv/", responseType: "token" ) let handle = oauthswift.authorize( withCallbackURL: URL(string: "com.googleusercontent.apps.984813079630-3lmlrubo9345ng4qhtf62ud1i02m6ta8")!, scope: "profile", state:"GOOGLE" credential, response, parameters in print(credential.oauthToken) // 执行你的请求 }, failure: { error in print(error.localizedDescription) } )
你可以帮帮我吗 ?
| 归档时间: |
|
| 查看次数: |
4216 次 |
| 最近记录: |