Can't find Request.GetOwinContext

后端 未结 13 1271
北荒
北荒 2020-12-04 22:47

I have been searching for an hour trying to figure out why this isn\'t working.

I have a ASP.Net MVC 5 application with a WebAPI. I am trying to get Request.GetOwin

13条回答
  •  臣服心动
    2020-12-04 23:36

    After looking at the ASP.NET default project I discovered I needed to include this in my application startup:

    // Enable the application to use a cookie to store information for the signed in user
    // and to use a cookie to temporarily store information about a user logging in 
    // with a third party login provider
    app.UseCookieAuthentication(new CookieAuthenticationOptions());
    app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);`
    

提交回复
热议问题