diff --git a/src/Ocelot/Infrastructure/Claims/Parser/ClaimsParser.cs b/src/Ocelot/Infrastructure/Claims/Parser/ClaimsParser.cs index 773b4375..e25a58c8 100644 --- a/src/Ocelot/Infrastructure/Claims/Parser/ClaimsParser.cs +++ b/src/Ocelot/Infrastructure/Claims/Parser/ClaimsParser.cs @@ -1,6 +1,6 @@ namespace Ocelot.Infrastructure.Claims.Parser { - using Errors; + using Microsoft.Extensions.Primitives; using Responses; using System.Collections.Generic; using System.Linq; @@ -45,14 +45,14 @@ private Response GetValue(IEnumerable claims, string key) { - var claim = claims.FirstOrDefault(c => c.Type == key); + var claimValues = claims.Where(c => c.Type == key).Select(c => c.Value).ToArray(); - if (claim != null) + if (claimValues.Length > 0) { - return new OkResponse(claim.Value); + return new OkResponse(new StringValues(claimValues).ToString()); } return new ErrorResponse(new CannotFindClaimError($"Cannot find claim for key: {key}")); } } -} +}