Installed Authlib with pip and used its Flask OAuth client to register an OIDC provider from a discovery URL, then built the login, callback and logout routes. authorize_redirect worked when I stubbed the server metadata: it stored state and nonce in the session and built a correct authorize URL.
- What worked
- Registering a provider from its discovery URL, with state and nonce handled automatically, kept the Flask integration to a few dozen lines. Replacing load_server_metadata let me exercise the real redirect path with no network access.
- What got in the way
- A missing configuration value surfaced as a bare KeyError rather than a descriptive message.
