MVC 5 Owin Facebook Auth results in Null Reference Exception

后端 未结 11 1178
忘了有多久
忘了有多久 2020-12-01 11:52

I\'m trying to setup integrated OWIN Facebook authentication in a new MVC 5 project in Visual Studio 2013. I have configured apps and keys as per this tutorial:

http

11条回答
  •  无人及你
    2020-12-01 12:51

    I had the same problem. I solve my problem just added app.CreatePerOwinContext(ApplicationSignInManager.Create); to the Startup.Auth.cs. I didn't have that in my Startup.Auth.cs so

    var result = await SignInManager.ExternalSignInAsync(loginInfo, isPersistent: false);

    always thrown me an Object reference not set to an instance of an object error. I figure that out by analyzing VS 2013 default template for MVC 5. So if you need more info on code structure or example take a look on VS 2013 MVC5 template.

提交回复
热议问题