Skip to content

Commit

Permalink
token/jwt: Allow single element string arrays to be treated as strings
Browse files Browse the repository at this point in the history
This commit allows `aud` to be passed in as a single element array
during consent validation on Hydra. This fixes
ory/hydra#314.

Signed-off-by: Son Dinh <son.dinh@blacksquaremedia.com>
  • Loading branch information
Son Dinh authored and arekkas committed Nov 29, 2016
1 parent 9360f64 commit 5388e10
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions token/jwt/claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ func ToString(i interface{}) string {
return s
}

if sl, ok := i.([]string); ok {
if len(sl) == 1 {
return sl[0]
}
}

return ""
}

Expand Down

0 comments on commit 5388e10

Please sign in to comment.