Windows and Anonymous Authentication in .Net Core 2.0

后端 未结 2 994
迷失自我
迷失自我 2020-12-24 15:17

I\'m trying to mix Windows and Anonymous authentication in a .Net Core 2.0 empty web app. I would like to avoid th

2条回答
  •  囚心锁ツ
    2020-12-24 15:55

    Anonymous takes precedence. You need to call httpContext.ChallengeAsync() when you get an anonymous request to a restricted part of your app. That will cause the client to send credentials on the next request. Here's a test that does this.

提交回复
热议问题