mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #338] authorizeURLHandler: How do I know when OAuthSwift has sent the user to Safari? #209
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#209
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 @dannymout on GitHub (Feb 16, 2017).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/338
Description:
In my app, I want to get a token, so I'll send my user to the OAuth provider, I'm doing this by redirecting them to Safari:
OAuthSwift.authorizeURLHandler = OAuthSwiftOpenURLExternally.sharedInstanceEverything works perfectly, but one question: How do I know when my app has sent the user to Safari?
OAuth Provider (Twitter, Github, ..):
Not important.
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
8.0 (Swift 3.0)
8.0 (Swift 2.3)
7.3.1
other: (Please fill in the version you are using.)
objective c
@phimage commented on GitHub (Feb 17, 2017):
the oauth flow with
OAuthSwiftOpenURLExternally:there is no user information sent from the app to safari
@dannymout commented on GitHub (Feb 17, 2017):
@phimage Correct, but when using
OAuthSwiftOpenURLExternally, the app will automatically send the user to Safari, I don't need any user data. I just want to know when OAuthSwift has redirected to Safari. Is there a way to do that?@phimage commented on GitHub (Feb 17, 2017):
there is no "user" send to safari
just url open with on iOS : UIApplication.shared.openURL(url)
If you use OAuth version 2, just after calling
authorizesafari is open immediatelySo you know when it's done, because you call
authorizefor oauth version 1 is more complicated, there is before a request to the server
Then if you want a clean way to do this, implement your own
OAuthSwiftURLHandlerTypeand use itjust for information, OAuthSwiftOpenURLExternally is not recommend, apple do not allow it I think
so for ios9 there is SafariURLHandler with a delegate to know where safari is initialized
@dannymout commented on GitHub (Feb 19, 2017):
@phimage OK, so there is a way to open URLs in Safari, that would allow me to get approved by the App Store:
How would I set the URL handler to work with that?
@phimage commented on GitHub (Feb 19, 2017):
not in Safari but
SFSafariViewControllerusing OAuthSwiftSafariURLHandlerand for your question, I don't really understand why you want to open in safari a reddit url... nothing in relation with OAuth
UIApplication.shared.open(url)is equivalent toOAuthSwiftOpenURLExternally.handle(url)