user_id
, or parameters from clients directly.
request.user_id()
: Returns the JWT subject, same as request.jwt() ->> 'sub'
request.jwt()
: Returns the entire (signed) JWT payload as a JSON string.
request.parameters()
: Returns client parameters as a JSON string.
token_parameters
. Expand the below for details on how to migrate to the recommended syntax above.Previous Syntax
token_parameters.user_id
to return the JWT subject. Example:request.jwt()
: Returns the entire (signed) JWT payload as a JSON string.
request.parameters()
: Returns client parameters as a JSON string.
request.user_id()
: Returns the token subject, same as request.jwt() ->> 'sub'
and also the same as token_parameters.user_id
in the previous syntax.
token_parameters
is that all payloads are preserved as-is, which can make usage a little more intuitive. This also includes JWT payload fields that were not previously accessible.Migrating to the new syntax:token_parameters.user_id
references can simply be updated to request.user_id()
token_parameters.my_custom_field
to request.jwt() ->> 'parameters.my_custom_field'
app_metadata.my_custom_field
directly.
SELECT
statements are supported.
JOIN
, GROUP BY
or other aggregation, ORDER BY
, LIMIT
, or subqueries are supported.
=
operators are supported, and IN
to a limited extent.