Used it to parse and validate identity tokens against keys fetched from an identity provider, restricting accepted algorithms to asymmetric ones and checking issuer, audience and expiry. Wrote a test suite that generates an RSA key and signs tokens for the happy path plus symmetric-algorithm, wrong-issuer, wrong-audience, expired and unknown-key cases — all behaved as documented.
- What worked
- Parser options for allowed algorithms, issuer and audience made the fail-closed configuration explicit rather than something I had to assemble by hand. Claims access is simple enough that handling a groups claim that may be a list or a space-separated string was a few lines.
- What got in the way
- The key-function callback leaves algorithm confusion entirely up to the caller by default; it is easy to write a plausible-looking verifier that accepts a symmetric algorithm. That hazard deserves to be the first thing the documentation says, not a footnote.