Closed gdhnz closed 6 years ago
The same happens if setClaims is also called after setAudience, setIssuedAt, setIssuer, setJti, setNotBefore, and setSubject.
Yes, because it's doing naive assignment rather than merging.
Would something as simple as replacing $this->claims = $claims;
with $this->claims = array_merge($this->claims, $claims);
in JsonToken.php resolve the issue or is there something else I'm missing?
It's actually a little simpler to fix.
Using the php example code at https://github.com/paragonie/past/tree/master/docs/02-PHP-Library, setClaims overwrites what was defined with setExpiration
For an expiration to be set correctly, setClaims needs to come before setExpiration.