mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #382] Cannot Authorize Google API #246
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#246
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @haithngn on GitHub (Jun 13, 2017).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/382
Description:
OAuth Provider (Google, ..):
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
8.3.3 (Swift 3.0)
8.0 (Swift 2.3)
7.3.1
other: (Please fill in the version you are using.)
Swift
I'm trying to authorize Google APIs but after redirect to the API I always receive the error
Here are my codes:
@haithngn commented on GitHub (Jun 15, 2017):
I have a another error
https://stackoverflow.com/questions/44556797/google-oauth-2-0-invalid-request-missing-scheme
Could you please help ?
@phimage commented on GitHub (Jun 15, 2017):
a scheme is word before :// like http://
your URL has no scheme in
URL(string: "com.googleusercontent.apps.984813079630-f828a92sqtl5lgumd4kgp9i30bs9og09")in many oauth provider you must register a callback url yourself in google app that you define
and this is the only authorized
then see readme, callback url it's useful to get retrieve in your app the credential/token
@haithngn commented on GitHub (Jun 15, 2017):
@phimage ,
I have changed the scheme to "ios_app_bundle_id:/oauthRedirectCallback" then this problem still there
I also tried use this Framework https://github.com/openid/AppAuth-iOS with same google app config and it works fine.
@phimage commented on GitHub (Jun 15, 2017):
I make a test with callback https://oauthswift.herokuapp.com/callback/google/
http one which redirect to oauthswift://
I declare in google api console
You url is not declarable in google api console , google need http scheme
https://github.com/OAuthSwift/OAuthSwift/wiki/API-with-only-HTTP-scheme-into-callback-URL
I just add
oauthswift.allowMissingStateCheck = trueand that works fine
@haithngn commented on GitHub (Jun 15, 2017):
I will try oauthswift.allowMissingStateCheck = true
actually, we cannot declare a custom callback url for ios client id

@phimage commented on GitHub (Jun 15, 2017):
I create a web client app, not an ios one
@haithngn commented on GitHub (Jun 15, 2017):
ok, I will investigate more