Validate an auth token (App users API)
Check a Softr app user's authentication token (JWT) from your own backend with the App Users API, to confirm that a request comes from a signed-in user.
Use this endpoint to check a user’s authentication token (JWT) from a system outside Softr. For example, your backend can check that a request comes from a signed-in user before saving their data.
curl --location --request POST 'https://yourdomain.softr.app/v1/api/users/validate-token' \
--header 'Content-Type: application/json' \
--data-raw '{"jwt":"your jwt token value"}'Replace yourdomain.softr.app with your app’s Softr subdomain or the custom domain you connected. Replace your jwt token value with the token you want to check.
Response
The body is a plain JSON boolean. It has no user data.
truefalseWhat the endpoint checks
The endpoint returns true only when all of these are true:
- The token has a valid Softr signature.
- The user has not signed out, and has not changed their password, since the token was created.
- The session has not expired.
- The user from the token is a user of the app on the domain you called.
How long a token is valid
The token has no exp claim. Softr reads the iat claim (when the token was created) and checks it against the app’s Log user out setting, such as Every 90 days. See User authentication.
Softr does not refresh tokens. When the session ends, the user signs in again and gets a new token.
When a user signs out or changes their password, all their older tokens become invalid. It can take up to about 10 seconds before every Softr server rejects them.