mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-27 05:05:51 +03:00
[GH-ISSUE #87] authorizeWithCallbackURL does nothing with Uber #52
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#52
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 @sephethus on GitHub (Aug 2, 2015).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/87
I execute the following but nothing happens:
Shouldn't it launch the Safari browser to authenticate with Uber?
@sephethus commented on GitHub (Aug 2, 2015):
I've also tried reversing parameters with response in the success closure but it doesn't change anything. Nothing happens. Nothing in the debug window.
@sephethus commented on GitHub (Aug 2, 2015):
Further examination through the OAuthSwift method authorizeWithCallbackURL I found this does not happen here:
I tried println(urlString) and it looks fine as a URL. I'm not sure why it's not getting converted to NSURL here. There's no reason why it shouldn't. I even added the following above it with no compile errors:
However if I println(q) it becomes nil for some weird reason.
@phimage commented on GitHub (Aug 2, 2015):
The value of urlstring is?
Maybe encoded, maybe special character hidden
@sephethus commented on GitHub (Aug 2, 2015):
Ok I found the answer. The problem was that the scope was not being percent escaped. "profile history" had to be changed to "profile%20history". This could be fixed by updating that urlString to be percent escaped.
Now I'm getting an entirely different error from uber's page: Invalid Request Parameters
@phimage commented on GitHub (Aug 2, 2015):
So maybe a fix needed to encode scope
@sephethus commented on GitHub (Aug 2, 2015):
Yes, this worked here:
However, I'm sure it could be written better.
I still get invalid request parameters though, so not sure what's up with that. This is the url it's sending to UBER:
@damianesteban commented on GitHub (Aug 19, 2015):
I'm having the same issue with the GitHub example...
authorizeWithCallbackURLcurrently does nothing.@sephethus commented on GitHub (Aug 19, 2015):
See above, you'll have to make sure the url string is percent encoded before being passed to the handle method. This is found in OAuth2Swift.swift, I had to add the above lines. This whole thing is a doozy though, took me a while to get and basically I had to just sit down for an hour or two and figure out how OAuthSwift works step by step, now I'm dealing with Uber's sandbox issues.
@damianesteban commented on GitHub (Aug 19, 2015):
I'm working with the Swift 2 branch actually and I'm presenting the login screen with a
SFSafariViewController. I was convinced I was using it incorrectly, but this did the trick. Thank you.@dongri commented on GitHub (Aug 26, 2015):
Hi @sephethus @phimage @damianesteban
I Resolved Uber OAuth problem
https://github.com/dongri/OAuthSwift/pull/96/files
Thanks!
@sephethus commented on GitHub (Aug 26, 2015):
@dongri there is still an issue in the authorizeWithCallBackURL. Uber gets an Invalid Request Parameters if the callback url is included in the URL string. I have to comment out that line
urlString += "&redirect_uri=\(callbackURL.absoluteString!)"just to fix it. Other than that it looks like the main issues are fixed.