User.Identity.IsAuthenticated always false in .net core custom authentication

前端 未结 4 1440
無奈伤痛
無奈伤痛 2020-12-30 04:25

Can anyone please check below code and let me know why I\'m getting always false (User.Identity.IsAuthenticated)??. I\'m getting cookie on my browser properly and able to

4条回答
  •  一整个雨季
    2020-12-30 04:56

    In my case the problem was in the startup file. app.UseAuthentication() line was coming after app.UseMvc() line.I reversed the orders and it started to work.

提交回复
热议问题