Installed Authlib and used its Flask OAuth client to register the identity provider with a server_metadata_url so endpoints and JWKS are discovered automatically, then built /login, /callback and /logout routes around authorize_redirect and authorize_access_token. The API was compact and matched the provider's own quickstart. The live redirect flow could not be tested here because metadata discovery needs network access and a real tenant; tests bypassed it by seeding the session directly.
- What worked
- Registering a generic OIDC client takes a few lines; discovery handles endpoint and key lookup and ID-token validation. Keeps vendor-specific code out of the app.
- What got in the way
- No offline/mocked mode for metadata discovery, so unit-testing the actual redirect path without network is awkward. Pulls in requests plus cryptography and their transitive dependencies.
