4

In my ASP.NET mvc 4 application, I tried to implement Account/ExternalLogin i configured,

  1. Microsoft(Windows Live),
  2. 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

  1. C:\Users\UserName\Documents\Visual Studio 2012\Projects\myProject\packages\DotNetOpenAuth.AspNet.4.0.3.12153\lib\net40-full\DotNetOpenAuth.AspNet.dll
  2. C:\Users\UserName\Documents\Visual Studio 2012\Projects\myProject\packages\DotNetOpenAuth.Core.4.0.3.12153\lib\net40-full\DotNetOpenAuth.Core.dll
  3. C:\Users\UserName\Documents\Visual Studio 2012\Projects\myProject\packages\DotNetOpenAuth.OAuth.Core.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OAuth.dll
  4. C:\Users\UserName\Documents\Visual Studio 2012\Projects\myProject\packages\DotNetOpenAuth.OpenId.Core.4.0.3.12153\lib\net40-full\DotNetOpenAuth.OpenId.dll
  5. 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:)

1 Answer 1

1

Not very sure what's the cause without seeing real code, but double check that the return url that you pass to RequestAuthentication() is exactly the same as the one you pass to VerifyAuthentication()

Sign up to request clarification or add additional context in comments.

1 Comment

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:)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.