[GH-ISSUE #65] Problem with authenticating via Tumblr #40

Closed
opened 2026-03-03 16:45:06 +03:00 by kerem · 3 comments
Owner

Originally created by @pschneider on GitHub (May 14, 2015).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/65

Hi,

I'm currently trying to authenticate via Tumblr OAuth1. Unfortunately I'm always getting the following error when coming back from Mobile Safari:

Error Domain=oauthswift.error Code=-1 "The operation couldn’t be completed. Oauth problem." UserInfo=0x7fc56290abe0 {NSLocalizedFailureReason=Oauth problem.}

I'm using the following URLs as mentioned on Tumblr docs

let requestTokenURL = "http://www.tumblr.com/oauth/request_token"
let authorizeURL = "http://www.tumblr.com/oauth/authorize"
let accessTokenURL = "http://www.tumblr.com/oauth/access_token"

Tumblr's documentation stated that their implementation is very similar with Twitter, but if I change the key/secret and the URLs to Twitter's API everything works fine.

Does anyone know what kind of problem I'm facing here? Could this be an Issue with the OAuth Library itself?

Thanks!

Edit: Tumblr Sends valid oauth_token and oauth_verifier Parameters back. The url looks just like when authenticating against twitter.

Originally created by @pschneider on GitHub (May 14, 2015). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/65 Hi, I'm currently trying to authenticate via Tumblr OAuth1. Unfortunately I'm always getting the following error when coming back from Mobile Safari: ``` Error Domain=oauthswift.error Code=-1 "The operation couldn’t be completed. Oauth problem." UserInfo=0x7fc56290abe0 {NSLocalizedFailureReason=Oauth problem.} ``` I'm using the following URLs as mentioned on [Tumblr docs](https://www.tumblr.com/docs/en/api/v2#auth) ``` let requestTokenURL = "http://www.tumblr.com/oauth/request_token" let authorizeURL = "http://www.tumblr.com/oauth/authorize" let accessTokenURL = "http://www.tumblr.com/oauth/access_token" ``` Tumblr's documentation stated that their implementation is very similar with Twitter, but if I change the key/secret and the URLs to Twitter's API everything works fine. Does anyone know what kind of problem I'm facing here? Could this be an Issue with the OAuth Library itself? Thanks! Edit: Tumblr Sends valid oauth_token and oauth_verifier Parameters back. The url looks just like when authenticating against twitter.
kerem closed this issue 2026-03-03 16:45:06 +03:00
Author
Owner

@pschneider commented on GitHub (May 14, 2015):

The problem seems to be that Tumblr adds the following URL fragment at the end of the callback:

#_=_

So the parameters are overwritten in authorizeWithCallbackURL.

// until here everything is fine for both
if ((url.fragment) != nil && url.fragment!.isEmpty == false) {
    println("Tumblr goes here")
    parameters = url.fragment!.parametersFromQueryString()
} else {
    println("Twitter goes here")
}
// parameters for Tumblr are nil, Twitter is fine
<!-- gh-comment-id:102147225 --> @pschneider commented on GitHub (May 14, 2015): The problem seems to be that Tumblr adds the following URL fragment at the end of the callback: ``` #_=_ ``` So the parameters are overwritten in authorizeWithCallbackURL. ``` // until here everything is fine for both if ((url.fragment) != nil && url.fragment!.isEmpty == false) { println("Tumblr goes here") parameters = url.fragment!.parametersFromQueryString() } else { println("Twitter goes here") } // parameters for Tumblr are nil, Twitter is fine ```
Author
Owner

@dongri commented on GitHub (Jun 1, 2015):

Fix:
github.com/dongri/OAuthSwift@1babc0f465

<!-- gh-comment-id:107501199 --> @dongri commented on GitHub (Jun 1, 2015): Fix: https://github.com/dongri/OAuthSwift/commit/1babc0f465144411c0dd9721271f239685ce83a9
Author
Owner

@pschneider commented on GitHub (Jun 9, 2015):

Thank you @dongri !

<!-- gh-comment-id:110422137 --> @pschneider commented on GitHub (Jun 9, 2015): Thank you @dongri !
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#40
No description provided.