Insites Docs Developers guide Data and UsersUsersAuthenticating a User with a JWT Token

AI answers drawn only from these docs, with links to the pages used.

Authenticating a User with a JWT Token

Last updated on October 09, 2026.

This guide discusses how to authenticate JSON requests with a JWT token.

Prerequisites

To follow the steps in this tutorial, you must understand the concept of pages, users, and Permissions.

Steps

Authenticating a user with a JWT token is a three-step process:

  • Step 1: Fetch the JWT token for a user
  • Step 2: Create a page with a policy that checks the JWT token
  • Step 3: Send signed request

Step 1: Fetch JWT Token for a User

You can do this after the user login; The system should usually store the token in the browser memory.

app/graphql/user_jwt_token.graphql

Note

Tokens from expire. By default, they expire after the session timeout, and a password change revokes them.

Step 2: Create a Page with a Policy that Checks the JWT Token

The Authorization Policy fetches the JWT token from the request header and sets the current user using this token.

app/graphql/jwt_login.graphql

app/authorization_policies/api_set_current_user.liquid

An Authorization Policy must print true or false on every path. This one prints false when the request has no Authorization header.

app/views/pages/api/orders.json.liquid

Step 3: Send the Signed Request

curl

js fetch

Have a suggestion for this page?

Didn't quite find what you are looking for or have feedback on how we can make the content better then we would love to hear from you. Please provide us feedback and we will get back to you shortly.