In my ASP.NET mvc 4 application, I tried to implement Account/ExternalLogin i configured,
- Microsoft(Windows Live),
Facebook with ClientID and ClientSecret and enabled GoogleOpenAuth unfortunately nothing is working.
Url call: provider=microsoft&sid=95b923de889e4a4db6861c98fafb42a3&code=f85770b1-266b-3abd-4c46-8d62fe3014dc">http://mydomain.com/account/externallogincallback?provider=microsoft&sid=95b923de889e4a4db6861c98fafb42a3&code=f85770b1-266b-3abd-4c46-8d62fe3014dc
AuthenticationResult result = OAuthWebSecurity.VerifyAuthentication(Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl }));
All OpenAuth calls are failing, Google will return with authentication false, Facebook and Microsoft(Windows Live) gives 400 bad request responses.
Can any one suggest how to resolve this?
More details: These are the DLL I used
- C:\Users\UserName\Documents\Visual Studio 2012\Projects\myProject\packages\DotNetOpenAuth.AspNet.4.0.3.12153\lib\net40-full\DotNetOpenAuth.AspNet.dll
- C:\Users\UserName\Documents\Visual Studio 2012\Projects\myProject\packages\DotNetOpenAuth.Core.4.0.3.12153\lib\net40-full\DotNetOpenAuth.Core.dll
- C:\Users\UserName\Documents\Visual Studio 2012\Projects\myProject\packages\DotNetOpenAuth.OAuth.Core.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OAuth.dll
- C:\Users\UserName\Documents\Visual Studio 2012\Projects\myProject\packages\DotNetOpenAuth.OpenId.Core.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OpenId.dll
- C:\Users\UserName\Documents\Visual Studio 2012\Projects\myProject\packages\DotNetOpenAuth.OpenId.RelyingParty.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OpenId.RelyingParty.dll
Web.config
<compilation debug="true" targetFramework="4.5" >
<assemblies>
<add assembly="WebMatrix.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="WebMatrix.WebData, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>
Found the problem: Well i figured it out, I had a custom function triggered at application start, that will enforce the full url to lower case and when OAuth token is called back to Facebook, token value is also lower cased, that was creating problem. glad that i could find it out:)