Note : After resolving the redirection issue i had an another issue that is getting an error \"Cannot cast Newtonsoft.Json.Linq.JArray to Newtonsoft.Json.Linq.JToken\". So i
I had the same problem with having multiple roles. Here is the solution for it:
.AddOpenIdConnect("oidc", options =>
{
// ...
options.Scope.Add("roles");
// ... using MapJsonKey instead of MapUniqueJsonKey for having 2 or more roles
options.ClaimActions.MapJsonKey(claimType: "role", jsonKey: "role");
});