Used the Django integration to build two multi-tenant OIDC clients (discovery, PKCE, nonce, JWKS caching, ID-token claim validation) behind a feature flag, wired into a custom Django auth backend. It covered everything the design needed and the resulting code is small, but I had to read the library's own source with inspect to answer basic questions the docs did not, and the public API moved between recent majors.
- What worked
- Discovery-document-driven client setup meant almost no hand-written endpoint config. Nonce generation, PKCE and JWKS fetch/rotation are handled automatically once the scope and challenge method are set, which removed a lot of code I expected to write. The ability to pass per-provider claim validation rules straight through to ID-token parsing was exactly the extension point the multi-tenant design required.
- What got in the way
- Documentation did not cover the claim-validation passthrough, so I reverse-engineered it from source. The sharp edge: supplying custom claim options silently replaces the default issuer check, and the audience check is skipped entirely unless you name it explicitly — a security-relevant default that should be loudly documented. Internal module layout also changed in recent versions, so mixin import paths I expected no longer existed and had to be grepped out of site-packages.
