Trouble getting ClaimsPrincipal populated when using EasyAuth to authenticate against AAD on Azure App Service in a Asp.Net Core web app

后端 未结 5 2122
逝去的感伤
逝去的感伤 2020-11-29 09:13

We have a web app built on Asp.Net core. It doesn\'t contain any authentication middleware configured in it.

We are hosting on Azure App Service and using the Authen

5条回答
  •  悲哀的现实
    2020-11-29 09:17

    You can give this library a try. I faced a similar problem and created this to simplify the use.

    https://github.com/dasiths/NEasyAuthMiddleware

    Azure App Service Authentication (EasyAuth) middleware for ASP.NET CORE with fully customizable components with support for local debugging

    It hydrates the HttpContext.User by registering a custom authentication handler. To make things easier when running locally, it even has the ability to use a json file to load mocked claims.

提交回复
热议问题