Here's my problem: I'm trying to get the current users profile url on stackoverflow using the stackexchange 2.0 API. If the user is logged in then everything works fine, the OAuth flow gives me the access token and I can get every info I want. But if the user is not logged in, stackexchange asks the user to log in using any of the authentication methods(google, facebook, yahoo, etc..) but after the user logs in (lets say with google) the response I get is a bad request.
My first request for authorization code looks like this:
after this it returns with the code in the url and I want to exchange it with an access token with a Post request like this:
https://stackexchange.com/oauth/access_token?client_id=193&redirect_uri=https%3a%2f%2fdioslaska.homelinux.org%2fcards%2fcard%2feditcards&client_secret={my client secret here}&code=tCEeEFp1UX2GYilnjR2GcA))
The response is an error 400 bad request. I have looked up the stackexchange api documentation and it says only that it is a bad parameter. But I use the same parameters when I do this for a user who is already logged in, and it works.
I have searched a lot, but couldn't find anything even similar to this problem. Any help would be appreciated!!
(I am using mvc 3 framework with visual studio 2010 if that's helpful)