Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oauth_callback can't be URL encoded when passing with GET #197

Open
arbel03 opened this issue Jan 22, 2017 · 1 comment
Open

oauth_callback can't be URL encoded when passing with GET #197

arbel03 opened this issue Jan 22, 2017 · 1 comment

Comments

@arbel03
Copy link

arbel03 commented Jan 22, 2017

Hi!
I am implementing my own OAuth1 handler and when trying to pass the oauth_callback I received a "URL Callback invalid" error multiple times,
when I changed my code of getting the query string that should look like this:

oauth_callback=...&oauth_consumer_key=...&oauth_nonce=...&oauth_signature=...&oauth_signature_method=HMAC-SHA1&oauth_timestamp=...&oauth_version=1.0

With the parameters URL encoded to this:

    return getOAuthString(seperator: "&", format: { (key, value) -> String in
            //oauth_callback shouldn't be url encoded.

            final_value = key == "oauth_callback" ? value : value.urlEncoded()
            return "\(key)=\(final_value)"
    })

It suddenly worked.
a URL decode would help there a lot 👍 . Thanks!

@larssn
Copy link

larssn commented Aug 28, 2017

See this old pull request #92

Basically, the oauth_callback url gets double encoded.
Our current workaround is to double encode this param as well... to make the handshake work.

In JS (our params object):

const params = this.toRfc3986(`oauth_callback=${this.toRfc3986(callbackUrl)}&oauth_consumer_key=${key}&oauth_nonce=${nonce}&oauth_signature_method=${sigMet}&oauth_timestamp=${ts}&oauth_version=${ver}`);

Seeing as that pull request is from 2015, not sure it's on anyone's todolist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants