Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TYP header documentation #1046

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
@@ -102,6 +102,18 @@ Specifying Additional Headers
'eyJhbGciOiJIUzI1NiIsImtpZCI6IjIzMDQ5ODE1MWMyMTRiNzg4ZGQ5N2YyMmI4NTQxMGE1IiwidHlwIjoiSldUIn0.eyJzb21lIjoicGF5bG9hZCJ9.0n16c-shKKnw6gervyk1Dge35tvzbzQ_KCV3H3bgoJ0'


By default the ``typ`` is attaching to the headers. In case when you don't need to pass this header to the token, you have to explicitly null it.

.. code-block:: pycon

>>> jwt.encode(
... {"some": "payload"},
... "secret",
... algorithm="HS256",
... headers={"typ": None},
... )


Reading the Claimset without Validation
---------------------------------------