Changelog¶
2.4.0 (2025-06-16)¶
Added¶
Add
unique_idmethod to User (8333a82)
Fixed¶
2.3.1 (2025-03-05)¶
Added¶
Make the
client_secrets.jsonfile optional when OIDC is disabled (1566f85)
Fixed¶
2.3.0 (2025-03-04)¶
Added¶
Fixed¶
2.2.2 (2024-10-24)¶
Added¶
Re-add
redirect_to_auth_server()for compatibility with v1.x (d0cac91)
2.2.1 (2024-10-23)¶
Added¶
Fixed¶
2.2.0 (2024-06-11)¶
Added¶
Changed¶
Fixed¶
2.1.1 (2023-10-27)¶
Fixed¶
Avoid redirect loops when the app is not mounted on the webserver root (#52)
Changed¶
Use REUSE for licences
Convert the changelog to markdown
Added¶
Publish to PyPI and Github when a tag is pushed
2.1.0 (2023-10-09)¶
Fixed¶
Handle token expiration when there is no
refresh_tokenor no token URL (#39)
Changed¶
Restore the
OVERWRITE_REDIRECT_URIconfiguration option asOIDC_OVERWRITE_REDIRECT_URI.The
redirect_urithat is generated and sent to the ID provider is no longer forced to HTTPS, because the the OIDC spec is actually only a strong recommendation (#35). You can useOVERWRITE_REDIRECT_URIif you want to force it to HTTPS (or any other URL).
2.0.3 (2023-09-08)¶
Fixed¶
Changed¶
The
redirect_urithat is generated and sent to the ID provider is always HTTPS, as the OIDC spec mandates.Don’t request the
profilescope by default, as version 1.x used to do (#21).
2.0.2 (2023-08-23)¶
Fixed¶
Avoid a redirect loop on logout when the token is expired (#17).
Deprecated¶
Configuration option
OIDC_USERINFO_URL(and theuserinfo_urikey inclient_secrets) (#15).
2.0.1 (2023-08-22)¶
This is a bugfix release.
Fixed¶
Don’t crash if the
client_secretsdon’t contain auserinfo_urikey (#13).Handle older versions of Werkzeug.
2.0.0 (2023-08-21)¶
This is a major release that rebases the Flask OIDC API on Authlib.
Removed¶
Custom callback with the
OpenIDConnect.custom_callback()decoratorRegistration has been moved to the oidc-register package
Configuration option
OIDC_GOOGLE_APPS_DOMAINConfiguration option
OIDC_VALID_ISSUERSConfiguration option
OIDC_REQUIRE_VERIFIED_EMAILConfiguration option
OIDC_RESOURCE_CHECK_AUDThe following parameters of the
OpenIDConnectconstructor have been removed:credentials_storehttptimeurandom
Deprecated¶
Configuration option
OIDC_OPENID_REALMConfiguration option
OIDC_CALLBACK_ROUTEConfiguration option
OVERWRITE_REDIRECT_URIThe following configuration options have been removed because the functionality is now handled by Authlib:
OIDC_ID_TOKEN_COOKIE_NAMEOIDC_ID_TOKEN_COOKIE_PATHOIDC_ID_TOKEN_COOKIE_TTLOIDC_COOKIE_SECURE
The
OpenIDConnect.user_getinfo()andOpenIDConnect.user_getfield()methods are deprecated, you’ll find all the user information in the session:session["oidc_auth_profile"]. If you need to get the user information using a specific token, you can do so by callingg._oidc_auth.userinfo(token=token).The
OpenIDConnect.logout()method is deprecated, just redirect to the/logoutview.
Changed¶
The callback route (aka “redirect URL”) is not configurable with
OIDC_CALLBACK_ROUTE anymore. It is always /authorize, but a prefix can
be configured when instanciating the OpenIDConnect extension (or calling
its OpenIDConnect.init_app() method:
app = Flask(__name__)
openid = OpenIDConnect(app, prefix="/oidc")
# The OIDC redirect URL will be /oidc/authorize
This will also give you /login and /logout views, prefixed identically.
The OIDC_SCOPES configuration value should now be a string, where the
scopes are separated with spaces.
The minimum Python version is 3.8.
Added¶
The OpenIDConnect.accept_token() decorator now accepts a scopes parameter,
which is a list of scopes that the provided token must include for the view to
be authorized. It is an Authlib
ResourceProtector.
The Authlib app is available in the g._oidc_auth variable. This means that
there cannot be more than one OpenIDConnect extension on a given Flask
application. If you need more, we advise you to use Authlib directly.
Development¶
A pre-commit config has been added, please enable it with
pre-commit installUnit tests are run by Tox
A coverage report is produced, and the coverage must be 100%
The git submodule for documentation themes has been dropped
The code is formatted using Black
The code is linted using Ruff
The package metadata is managed by Poetry
CI is run using Github Actions, Travis config has been dropped
Dependencies are updated using Renovate