You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* in-process release 2.4.0 pending some late PR merges.
* Update #1311 documentation to recommend using RS256 rather than HS256.
* editorial changes to CHANGELOG
* fix line too long
Copy file name to clipboardExpand all lines: CHANGELOG.md
+40-21
Original file line number
Diff line number
Diff line change
@@ -15,35 +15,54 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
15
-->
16
16
17
17
## [unreleased]
18
-
18
+
### Added
19
+
### Changed
20
+
### Deprecated
21
+
### Removed
19
22
### Fixed
20
-
*#1292 Interpret `EXP` in AccessToken always as UTC instead of own key
21
-
*#1292 Introduce setting `AUTHENTICATION_SERVER_EXP_TIME_ZONE` to enable different time zone in case remote
22
-
authentication server doe snot provide EXP in UTC
23
+
### Security
24
+
25
+
## [2.4.0] - 2024-05-13
23
26
24
27
### WARNING
25
-
* If you are going to revert migration 0006 make note that previously hashed client_secret cannot be reverted
28
+
Issues caused by **Release 2.0.0 breaking changes** continue to be logged. Please **make sure to carefully read these release notes** before
29
+
performing a MAJOR upgrade to 2.x.
30
+
31
+
These issues both result in `{"error": "invalid_client"}`:
32
+
33
+
1. The application client secret is now hashed upon save. You must copy it before it is saved. Using the hashed value will fail.
34
+
35
+
2.`PKCE_REQUIRED` is now `True` by default. You should use PKCE with your client or set `PKCE_REQUIRED=False` if you are unable to fix the client.
36
+
37
+
If you are going to revert migration 0006 make note that previously hashed client_secret cannot be reverted!
26
38
27
39
### Added
28
-
*#1185 Add middleware for adding access token to request
29
-
*#1273 Add caching of loading of OIDC private key.
30
-
*#1285 Add post_logout_redirect_uris field in application views.
31
-
*#1311 Add option to disable client_secret hashing to allow verifying JWTs' signatures.
32
-
*#1337 Gracefully handle expired or deleted refresh tokens, in `validate_user`.
40
+
*#1304 Add `OAuth2ExtraTokenMiddleware` for adding access token to request.
41
+
See [Setup a provider](https://django-oauth-toolkit.readthedocs.io/en/latest/tutorial/tutorial_03.html#setup-a-provider) in the Tutorial.
42
+
*#1273 Performance improvement: Add caching of loading of OIDC private key.
43
+
*#1285 Add `post_logout_redirect_uris` field in the [Application Registration form](https://django-oauth-toolkit.readthedocs.io/en/latest/templates.html#application-registration-form-html)
44
+
*#1311,#1334 (**Security**) Add option to disable client_secret hashing to allow verifying JWTs' signatures when using
This means your client secret will be stored in cleartext but is the only way to successfully use HS256 signed JWT's.
33
47
*#1350 Support Python 3.12 and Django 5.0
34
-
*#1249 Add code_challenge_methods_supported property to auto discovery information, per [RFC 8414 section 2](https://www.rfc-editor.org/rfc/rfc8414.html#page-7)
35
-
*#1328 Adds the ability to define how to store a user profile
36
-
48
+
*#1367 Add `code_challenge_methods_supported` property to auto discovery information, per [RFC 8414 section 2](https://www.rfc-editor.org/rfc/rfc8414.html#page-7)
49
+
*#1328 Adds the ability to [define how to store a user profile](https://django-oauth-toolkit.readthedocs.io/en/latest/oidc.html#define-where-to-store-the-profile).
37
50
38
51
### Fixed
39
-
*#1322 Instructions in documentation on how to create a code challenge and code verifier
40
-
*#1284 Allow to logout with no id_token_hint even if the browser session already expired
41
-
*#1296 Added reverse function in migration 0006_alter_application_client_secret
42
-
*#1336 Fix encapsulation for Redirect URI scheme validation
43
-
*#1357 Move import of setting_changed signal from test to django core modules
44
-
*#1268 fix prompt=none redirects to login screen
45
-
*#1381 fix AttributeError in OAuth2ExtraTokenMiddleware when a custom AccessToken model is used
46
-
*#1288 fixes #1276 which attempt to resolve #1092 for requests that don't have a client_secret per [RFC 6749 4.1.1](https://www.rfc-editor.org/rfc/rfc6749.html#section-4.1.1)
52
+
*#1292 Interpret `EXP` in AccessToken always as UTC instead of (possibly) local timezone.
53
+
Use setting `AUTHENTICATION_SERVER_EXP_TIME_ZONE` to enable different time zone in case the remote
54
+
authentication server does not provide EXP in UTC.
55
+
*#1323 Fix instructions in [documentation](https://django-oauth-toolkit.readthedocs.io/en/latest/getting_started.html#authorization-code)
56
+
on how to create a code challenge and code verifier
57
+
*#1284 Fix a 500 error when trying to logout with no id_token_hint even if the browser session already expired.
58
+
*#1296 Added reverse function in migration `0006_alter_application_client_secret`. Note that reversing this migration cannot undo a hashed `client_secret`.
59
+
*#1345 Fix encapsulation for Redirect URI scheme validation. Deprecates `RedirectURIValidator` in favor of `AllowedURIValidator`.
60
+
*#1357 Move import of setting_changed signal from test to django core modules.
61
+
*#1361 Fix prompt=none redirects to login screen
62
+
*#1380 Fix AttributeError in OAuth2ExtraTokenMiddleware when a custom AccessToken model is used.
63
+
*#1288 Fix #1276 which attempted to resolve #1092 for requests that don't have a client_secret per [RFC 6749 4.1.1](https://www.rfc-editor.org/rfc/rfc6749.html#section-4.1.1)
64
+
*#1337 Gracefully handle expired or deleted refresh tokens, in `validate_user`.
Copy file name to clipboardExpand all lines: docs/getting_started.rst
+6-1
Original file line number
Diff line number
Diff line change
@@ -246,7 +246,12 @@ Point your browser to http://127.0.0.1:8000/o/applications/register/ lets create
246
246
247
247
Fill the form as show in the screenshot below and before save take note of ``Client id`` and ``Client secret``, we will use it in a minute.
248
248
249
-
If you want to use this application with OIDC and ``HS256`` (see :doc:`OpenID Connect <oidc>`), uncheck ``Hash client secret`` to allow verifying tokens using JWT signatures. This means your client secret will be stored in cleartext but is the only way to successfully use signed JWT's.
249
+
If you want to use this application with OIDC and ``HS256`` (see :doc:`OpenID Connect <oidc>`), uncheck ``Hash client secret`` to allow verifying tokens using JWT signatures. This means your client secret will be stored in cleartext but is the only way to successfully use signed JWT's with ``HS256``.
250
+
251
+
.. note::
252
+
``RS256`` is the more secure algorithm for signing your JWTs. Only use ``HS256`` if you must.
253
+
Using ``RS256`` will allow you to keep your ``client_secret`` hashed.
An optional layer to define where to store the profile in `UserModel` or a separate model. For example `UserOAuth`, where `user = models.OneToOneField(UserModel)` .
338
+
An optional layer to define where to store the profile in `UserModel` or a separate model.
339
+
For example `UserOAuth`, where `user = models.OneToOneField(UserModel)` .
339
340
340
341
The function is called after checking that username is in the content.
0 commit comments