OAuth2 fail!

Written by
reddit
Link to Post

https://www.reddit.com/r/golang/comments/bni82f/oauth2_fail/ by 

Trying to get OAuth2 working with the eBay API using the golang.org/x/oauth2 package.

I have reduced the problem to the minimal possible demonstration in a gist at

https://gist.github.com/tomcam/08460a1b0ed71b48cfd02be0cc3a6592

Here’s the sequence of events.

When you vist the root directory it is supposed to take you to eBay to sign in (as a sandbox user). It does so. When you sign in with a proper username and password, it’s supposed to take you to a page asking you to give permission to the app to make changes to the account. It does so. It then takes you to the authorization accepted page specified by the RuName, which it does. At that point it’s supposed to supply you with a long string the &code parameter representing the permission. And it does! I can see it the successfully returned token in the address bar of the browser!

However, when I use FormValue() or any other way to inspect the &code parameter, it returns an empty string, so as you see in the gist it displays the “Dude” error message.

Only the secrets have been changed in the gist. Obviously I couldn’t get as far as the as the authorization accepted page if I had them wrong.

Can anyone help me? If I had hair I’d be pulling it out.

submitted by /u/tomcam
[link] [comments]

Article Tags:
· ·
Article Categories:
reddit

Leave a Reply