ASP.NET MVC and Owin

Today I was working with Owin authentication and social media logins. Customer had reported a weird problem, that Twitter authentication was not working, even though I just tested it and it worked. So I opened my Chrome, tried login and it worked like a charm. Then I realized that they were using Internet Explorer. I Opened IE, tried to login with Twitter and Badam!
var result = await AuthenticationManager.AuthenticateAsync(DefaultAuthenticationTypes.ExternalCookie);
result variable was always null. I started to google problem and found this StackOverflow question: http://stackoverflow.com/questions/19564479/mvc-5-owin-facebook-auth-results-in-null-reference-exception question definitely related to my problem somehow, but confirmed answer didn't help me (because I already had updated code). Then finally I scrolled to bottom of answers and found this one:
I solved it by doing the following two steps: 1> Visual Studio Menu->Tools->Library Package Manager->Manage NuGet Packages for Solution..., then install package: Microsoft.Owin.Host.SystemWeb 2> In the same window, click Update (left bar) and then update all the packages.
So I went to Visual Studio, updated all my Owin packages into 3.0.1.0 (I had 3.0.0), opened IE and all worked again.


The best way to predict the future is to implement it.

5 kommenttia:

  1. This is a great resource. Thanks for sharing with us.!
    Web Design Sydney

    VastaaPoista
    Vastaukset
    1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru Dot Net Training in Chennai. Nowadays Dot Net has tons of job opportunities on various vertical industry.
      or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

      Poista
  2. Well somehow I got to read lots of articles on your blog. It’s amazing how interesting it is for me to visit you very often
    Web development Company in India Company | Web development Company Bangalore
    Web Development Company in Bangalore | Responsive Web development

    VastaaPoista
  3. Spark interact web design sydney is recruiting. check out the great new positions and apply online now

    VastaaPoista