Search code examples
asp.net-coreservicestackwindows-authentication

How to login using Windows Authentication in .NET Core with Servicestack


In previous applications using ServiceStack, me and my team have been using .NET Framework and the included AspNetWindowsAuthProvider.

Having switched to .NET Core we have discovered that the included provider is no longer in ServiceStack.Core.

How can I use Windows Authentication in a ServiceStack.Core application?


Solution

  • ServiceStack doesn't have a built-in Windows Auth Provider for .NET Core, a potential solution is to use ASP.NET Core's Identity Auth with ServiceStack, a pre-configured solution is available from the mvcidentity .NET Core Project Template.

    Then Configure Windows Authentication in the ASP.NET Core App which is used by the NetCoreIdentityAuthProvider to create an Authenticated ServiceStack Session from the Authenticated ASP.NET Core Identity.