(Environment: .net 6 web api) reference post: c# asp.net core Bearer error="invalid_token" solved my problem: https://stackoverflow.com/users/6143908/lancelot-lovejoy
I'm asking this question again because I do not have any points to comment on the original post, however, after spending 2 days on this I thought it was important to put this here: Lancelot Lovejoy had it bang on, the order matters. wherever you're defining your app object...
var app = builder.Build();
app.UseAuthentication(); // <-- first
app.UseAuthorization(); // <-- second
I don't know why the order matters, maybe someone can explain it to me, but I seriously lost 2 freaking days because of it. Hopefully, this will save someone that same time. Thank you a million times over Lancelot.