Skip to content

Commit 685a7b0

Browse files
committed
Update django-oauth#1311 documentation to recommend using RS256 rather than HS256.
1 parent c7caea1 commit 685a7b0

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ These issues both result in `{"error": "invalid_client"}`:
4141
See [Setup a provider](https://django-oauth-toolkit.readthedocs.io/en/latest/tutorial/tutorial_03.html#setup-a-provider) in the Tutorial.
4242
* #1273 Performance improvement: Add caching of loading of OIDC private key.
4343
* #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 Add option to disable client_secret hashing to allow verifying JWTs' signatures.
44+
* #1311 (**Security**) Add option to disable client_secret hashing to allow verifying JWTs' signatures when using
45+
[HS256 keys](https://django-oauth-toolkit.readthedocs.io/en/latest/oidc.html#using-hs256-keys).
46+
This means your client secret will be stored in cleartext but is the only way to successfully use HS256 signed JWT's.
4547
* #1337 Gracefully handle expired or deleted refresh tokens, in `validate_user`.
4648
* #1350 Support Python 3.12 and Django 5.0
4749
* #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)

docs/getting_started.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,12 @@ Point your browser to http://127.0.0.1:8000/o/applications/register/ lets create
246246

247247
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.
248248

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.
254+
250255

251256
.. image:: _images/application-register-auth-code.png
252257
:alt: Authorization code application registration

docs/oidc.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ scopes in your ``settings.py``::
149149
}
150150

151151
.. note::
152-
If you want to enable ``RS256`` at a later date, you can do so - just add
153-
the private key as described above.
152+
``RS256`` is the more secure algorithm for signing your JWTs. Only use ``HS256`` if you must.
153+
Using ``RS256`` will allow you to keep your ``client_secret`` hashed.
154154

155155

156156
RP-Initiated Logout

0 commit comments

Comments
 (0)