Hi @65841535 ,
You can see the details in this article.
And remember the middleware is
app.UseAuthentication();
app.UseAuthorization();
They are indispensable and the order is also very important.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.