Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1817 from IdentityServer/AmrFix
Browse files Browse the repository at this point in the history
Quick fix to turn amr claim into an array
  • Loading branch information
leastprivilege committed Sep 5, 2015
2 parents 90f7b83 + 5711eb2 commit e42f49a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/Core/Services/Default/DefaultTokenSigningService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ protected virtual string CreateJsonWebToken(Token token, SigningCredentials cred
DateTimeHelper.UtcNow.AddSeconds(token.Lifetime),
credentials);

// amr is an array - if there is only a single value turn it into an array
if (jwt.Payload.ContainsKey("amr"))
{
var amrValue = jwt.Payload["amr"] as string;
if (amrValue != null)
{
jwt.Payload["amr"] = new string[] { amrValue };
}
}

var x509credential = credentials as X509SigningCredentials;
if (x509credential != null)
{
Expand Down

0 comments on commit e42f49a

Please sign in to comment.