首页 新闻 会员 周边

asp.net webApi 的cookie验证问题

0
悬赏园豆:50 [已关闭问题] 关闭于 2018-12-11 16:49

.net core web 基于cookie验证用户是否登录,但是在.net core webapi 中验证失败,请求是带有登录cookie的 但是User.Identity.IsAuthentication总是false

.net core webapi 是不是有什么不同呢?

配置都是正确的,

 services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
    .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, o =>
    {
       ......
    });
serivces.AddMvc();


   app.UseAuthentication();
    app.UseMvc()
Shendu.CC的主页 Shendu.CC | 老鸟四级 | 园豆:2138
提问于:2018-12-11 16:32
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册