I\'m working on upgrading my .NET Core 2.2 MVC application to 3.0. In this application I\'m authenticating to a controller using a JWT token. The token contains several claims,
It seems the user isn't authenticated at all.
With asp.net core 3.0 routing has changed to Endpoint routing. You can opt-out by setting EnableEndpointRouting = false
.
But that seems not the case here. That means you'll have to include certain services when you use them, like authentication and authorization:
public void Configure(IApplicationBuilder app)
{
...
app.UseStaticFiles();
app.UseRouting();
app.UseCors();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints => {
endpoints.MapControllers();
});
And most important, in that order. As documentated here: Migrate Startup.Configure.