mattjohnsonpint / DotNetOpenAuth.GoogleOAuth2

DotNetOpenAuth OAuth2 Client for Google
23 stars 18 forks source link

The remote server returned an error: (400) Bad Request #9

Open ProNotion opened 9 years ago

ProNotion commented 9 years ago

At the OAuthWebSecurity.VerifyAuthentication() stage I am getting a 400 error with the following abbreviated stack trace :

[WebException: The remote server returned an error: (400) Bad Request.]
   System.Net.HttpWebRequest.GetResponse() +6518932
   DotNetOpenAuth.GoogleOAuth2.GoogleOAuth2Client.QueryAccessToken(Uri returnUrl, String authorizationCode) +647
   DotNetOpenAuth.AspNet.Clients.OAuth2Client.VerifyAuthentication(HttpContextBase context, Uri returnPageUrl) +142
   DotNetOpenAuth.AspNet.OpenAuthSecurityManager.VerifyAuthentication(String returnUrl) +239
   Microsoft.Web.WebPages.OAuth.OAuthWebSecurity.VerifyAuthenticationCore(HttpContextBase context, String returnUrl) +129
   Microsoft.Web.WebPages.OAuth.OAuthWebSecurity.VerifyAuthentication(String returnUrl) +86
   Microsoft.Web.WebPages.OAuth.OAuthWebSecurity.VerifyAuthentication() +7

I should probably add that yes I am called GoogleOAuth2Client.RewriteRequest(); before OAuthWebSecurity.VerifyAuthentication().

Any ideas on why this might be happening?

Thanks, Simon