mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 20:55:57 +03:00
[GH-ISSUE #275] "error" : "invalid_client" #163
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#163
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 @ivanruizscm on GitHub (Sep 20, 2016).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/275
OAuthSwift (0.5.2)
Xcode 7.3
Target IOS8
OAuth Server Google
Im trying to follow RW tutorial for OAuth2 but i can't connect, i end with this error.

I also attached a Demo where its only necesary to change client key and password.
Note its using swift 2.2 (xcode 7.3).
The strange thing in the tutorial is this image cause in the current version of credentials the "client secret" doesnt appear like this, now is:
So i had to go to "create credentails" and then click to API Key. So then i put Alza... to consumerSecret: ""
demo.zip
@ivanruizscm commented on GitHub (Sep 20, 2016):
In fact, when you create OAuth client ID if you dont select Web Application you dont get client secret and its a mandatory field :-?
So i'm a bit confused
@phimage commented on GitHub (Sep 20, 2016):
You can choose also "other" etc.. I think iOS specific case is for a special authentification mode using their sdk/api
ps: keep oauthswift in memory (by setting as attribute of your view controller)
@ivanruizscm commented on GitHub (Sep 20, 2016):
Now i get redirect uri miss match


@ivanruizscm commented on GitHub (Sep 20, 2016):
and the bundle id is com.raywenderlich.Incognito
Notice if i select "Other" i can't set the Bundle Id, probably the problem?
@ivanruizscm commented on GitHub (Sep 20, 2016):
As of:
https://support.google.com/googleapi/answer/6158849?hl=en-GB#installedapplications&ios
If your application accesses APIs directly from iOS, you will need the application's Bundle ID and (optionally) its Apple App Store ID.
@phimage commented on GitHub (Sep 20, 2016):
so that's not a real oauth flow, but some people have success to use google api according to some issues
redirect uri mismatch : you don't provide the same redirect url in swift code and google configuration page
maybe only http scheme is autorized
the google doc f=
https://developers.google.com/identity/protocols/OAuth2InstalledApp#overview
@ivanruizscm commented on GitHub (Sep 20, 2016):
basically if i set the credentials to iOS im able to give permission and get back to the app with "invalid client" error, but if i set to other then im uneable to give permission. So i'm not sure where to follow
@ivanruizscm commented on GitHub (Sep 21, 2016):
so theres no support for google oauth apis? Other frameworks seems also not using the client secret like AeroGearHttp
let googleConfig = GoogleConfig(
clientId: "YOUR_GOOGLE_CLIENT_ID", // [1] Define a Google configuration
scopes:["https://www.googleapis.com/auth/drive"]) // [2] Specify scope
@phimage commented on GitHub (Sep 21, 2016):
there is no really a google oauth api, there is oauth 1 and 2
then if google some weird things, that's not the OAuthSwift to support or not, just let user do some customisation in request if needed.
I have no time, to test google, but some before me have (see issue with google word inside)
@ivanruizscm commented on GitHub (Sep 21, 2016):
so sick,i removed the customerSecret by an empty string then.. it worked.
@martindufort commented on GitHub (Jun 27, 2018):
Got bitten by the same issue... Specify empty string for consumerSecret and everything worked fine.