Skip to content

Commit

Permalink
Fix create_id_token with extra scope claims + add ruff as formatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
juanifioren committed Dec 5, 2024
1 parent 1756c20 commit 1a1c55c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/sections/scopesclaims.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,11 @@ Inside your oidc_provider_settings.py file add the following class::

.. note::
If a field is empty or ``None`` inside the dictionary you return on the ``scope_scopename`` method, it will be cleaned from the response.

Include claims in the ID Token
==============================

The draft specifies that ID Tokens MAY include additional claims. You can add claims to the ID Token using ``OIDC_IDTOKEN_INCLUDE_CLAIMS``. Note that the claims will be filtered based on the token's scope.

.. note::
Any extra claims defined with ``OIDC_EXTRA_SCOPE_CLAIMS`` will also be included.
2 changes: 1 addition & 1 deletion docs/sections/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Read more about how to implement it in :ref:`scopesclaims` section.
OIDC_IDTOKEN_INCLUDE_CLAIMS
==============================

OPTIONAL. ``bool``. If enabled, id_token will include standard claims of the user (email, first name, etc.).
OPTIONAL. ``bool``. If enabled, id_token will include standard (and extra if defined) claims of the user (email, first name, etc.).

Default is ``False``.

Expand Down

0 comments on commit 1a1c55c

Please sign in to comment.