Closed
Description
In some cases it would be nice to have easy access to the values in the JWT header. Especially the Key ID, but also the algorithm if more than one was allowed.
Currently, one has to extract the header and decode it again.
Options for this would include a new version of decode() (naming is hard... like decodeWithHeader() maybe) that would return both the payload and the header in an array or object. The current decode() method could stay the same for BC and return the payload part of the compound result.
Another option could be to add another, optional method parameter passed-by-reference that would be populated with the header.