In my JWT I have a list of roles like this: {..., role: "1,2,3", ...}. When my request hits [Authorize(Role = "1")], it returns unauthorized.
Is there a way to parse this comma separated string into an array of roles on my AddAuthentication or AddJwtBearer calls?
You need to use this mapping:
instead of
I did write a lengthy post about these problems in a blog post here: Debugging OpenID Connect claim problems in ASP.NET Core