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
* Add documentation for "sub" (Subject) and "jti" (JWT ID) claims in usage.rst
* Refine documentation for "sub" and "jti" claims in usage.rst for clarity and detail
* fix typos
* add changelog entries
* fix submenu order
* fix failing doctest
* remove rudandant type case
Copy file name to clipboardExpand all lines: CHANGELOG.rst
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ Added
20
20
21
21
- Docs: Add example of using leeway with nbf by @djw8605 in `#1034 <https://github.com/jpadilla/pyjwt/pull/1034>`__
22
22
- Docs: Refactored docs with ``autodoc``; added ``PyJWS`` and ``jwt.algorithms`` docs by @pachewise in `#1045 <https://github.com/jpadilla/pyjwt/pull/1045>`__
23
+
- Docs: Documentation improvements for "sub" and "jti" claims by @cleder in `#1088 <https://github.com/jpadilla/pyjwt/pull/1088>`
Think of the `sub` claim as the **"who"** of the JWT.
371
+
It identifies the subject of the token — the user or entity that the token is about.
372
+
The claims inside a JWT are essentially statements about this subject.
373
+
374
+
For example, if you have a JWT for a logged-in user, the `sub` claim would typically be their unique user ID, like `1234567890`.
375
+
This value needs to be unique within your application's context so you can reliably identify who the token belongs to.
376
+
While the `sub` claim is optional, it's a fundamental part of most JWT-based authentication systems.
377
+
378
+
JWT ID Claim (jti)
379
+
~~~~~~~~~~~~~~~~~~
380
+
381
+
The "jti" (JWT ID) claim provides a unique identifier for the JWT.
382
+
The identifier value MUST be assigned in a manner that ensures that there is a negligible probability that the same value will be accidentally assigned to a different data object.
383
+
If the application uses multiple issuers, collisions MUST be prevented among values produced by different issuers as well.
0 commit comments