PostgREST has been doing this for a long time https://docs.postgrest.org/en/v13/references/auth.html#jwt-b...