app.UseAuthorization() on .NET Core WebApi 2.1 built on .NET Framework.
I was referencing your topic: https://docs.servicestack.net/templates-corefx and I am trying to get the [Authroize] tag working on .NET Core 2.1 Web API project built on .NET Framework. There is no IAppBuilder.UseAuthorization(). I wrote my own JWT custom auth handler and tried the following in the Startup:
.AddScheme<BasicAuthenticationOptions, EdcAuthenticationHandler>("Basic", null);
I also have
but, again, there is no app.UseAuthorization()
I want to be able to add [Authorize] attributes (with roles as well) and be able to access the User object inside my controller methods.
Any insight would be appreciated.
It sounds like you want to use create a Web API project using ASP.NET Core Identity Auth.
ServiceStack is its own entirely different software stack that has its own Auth Provider implementation & [Authenticate] attribute:
and its own JWT Provider:
We don’t support integration with ASP.NET Identity Auth in .NET Framework projects only in .NET Core projects: