Skip to content

Commit

Permalink
docs: add missing jwt claims and clock skew (#3908)
Browse files Browse the repository at this point in the history
  • Loading branch information
taimoorzaeem authored Feb 12, 2025
1 parent 307692c commit 560c511
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/references/auth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,15 @@ You can specify the literal value as we saw earlier, or reference a filename to
JWT Claims Validation
~~~~~~~~~~~~~~~~~~~~~

PostgREST honors the :code:`exp` claim for token expiration, rejecting expired tokens.
PostgREST honors the following `JWT claims <https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4>`_:

- ``exp`` Expiration Time
- ``iat`` Issued At
- ``nbf`` Not Before
- ``aud`` Audience, see :ref:`jwt-aud`

.. note::
PostgREST allows for a 30-second clock skew when validating the ``exp`` and ``iat`` claims. In other words, it gives an extra 30 seconds before the token is rejected if there is a slight discrepancy in the timestamps.

.. _jwt_role_claim_key_extract:

Expand Down

0 comments on commit 560c511

Please sign in to comment.