Authlib is a full OAuth 2.0 and OpenID Connect toolkit for Flask, Django, Starlette and httpx, and authlib.jose is the JWS, JWE, JWK and JWT layer it was built on. Importing it in 1.9.1 emits authlib.jose module is deprecated, please use joserfc instead.; the maintainers moved the JOSE code into the separate joserfc package, and the old module is kept for compatibility until 2.0. Existing code keeps working, but new code should target joserfc.
The detail that bites most often is that decode() checks only the signature. A token that had expired an hour earlier came back from decode() without complaint; expiry, issuer and audience are checked only when you call claims.validate() — with claims_options marking exp and iss as essential, because a token without them otherwise passes too. Leeway is zero unless you pass one to validate().
Algorithm handling depends on which object you use. The module-level jwt accepts every algorithm it knows and picks by key type, so an RS256 token presented with an EC key failed at key import; a JsonWebToken(["ES256"]) instance allows only what you list. Listing none is enough to make an unsigned token verify, so never let a configuration value end up in that list. HMAC keys that look like PEM public keys are refused with This key may not be safe to import, and ES256 refuses a P-384 key.
Supported algorithms in 1.9.1 cover the HS, RS, PS and ES families, ES256K and EdDSA, but not the Ed25519 or Ed448 names. ES256 signatures are 64 bytes of raw r‖s; a DER signature fails with bad_signature, which the JWT debugger and the DER ⇄ raw converter help diagnose. To check what an identity provider's tokens and keys look like, use the OIDC token validator and the JWKS checker.
The sample uses a restricted JsonWebToken instance and validates the claims explicitly — the two steps that the module-level API leaves out.