OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.43k stars 2.4k forks source link

Problems with accessing admin during windows authentication #5893

Open Dean-ZhenYao-Wang opened 4 years ago

Dean-ZhenYao-Wang commented 4 years ago
 "iisSettings": {
    "windowsAuthentication": true,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:2918",
      "sslPort": 44300
    }
  }

When both windowsAuthentication and anonymousAuthentication are set to true, the admin page is always inaccessible, prompting no permissions. There is also no way to jump to the admin landing page. old: context.Result = context.HttpContext.User.Identity.IsAuthenticated ? (IActionResult)new ForbidResult() : (IActionResult)new ChallengeResult(); new context.Result= !context.HttpContext.User.Identity.IsAuthenticated ? (IActionResult)new ForbidResult() : (IActionResult)new ChallengeResult(); When I use the NEW code, I can solve this problem。 image

Dean-ZhenYao-Wang commented 2 years ago

@sebastienros Hi, hasn't the problem been solved yet? I see the problem has not been closed.

hishamco commented 2 years ago

Did you try it in empty ASP.NET Core app? Is it working?

Dean-ZhenYao-Wang commented 2 years ago

Yes, it works with Asp.NetCore 3.1.

hishamco commented 2 years ago

Could you try it in net6.0? Hope to check this with OC in upcoming days