mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #247] How to do Google+/Youtube authentication correctly? #140
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#140
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 @martinpilch on GitHub (Jun 30, 2016).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/247
Hello,
I'm trying to sign-in into Youtube and Google+ API using
SafariURLHandler. Anytime I pass through the process and press Allow Safari tells me it can't open the page because address is invalidIn your dem I noticed you are using
https://oauthswift.herokuapp.com/callback/googleas Callback URL for GoogleDrive. I guess it's doing kind of redirect. How exactly does it work?Thanks,
Martin
@phimage commented on GitHub (Jun 30, 2016):
Yes it's redirect the url to a new one with scheme oauthswift://. (Custom scheme allow to pass information to the application, query of the url)
Herokuapp is used because Google accept only http:// url scheme.
Check also that your callback url must be declared or not in your Google account.
@martinpilch commented on GitHub (Jun 30, 2016):
That's weird. Because my URL scheme I can see in Google Console is:
com.googleusercontent.apps.XXXXXXXXXXXXXXXXXXXHow is that possible? Are you able to authorise against G+ or Youtube?
@martinpilch commented on GitHub (Jun 30, 2016):
So I found solution. It's necessary to:
com.googleusercontent.apps.XXXXXXXXXXXXXXXXXXXinto Supported URL schemesLSApplicationQueriesSchemessection in plist.Then it's not necessary to do any redirect
This post helped me out: http://stackoverflow.com/questions/31506865/google-sign-in-crashes-on-ios-9-attempting-to-call-canopenurl