Skip to main content

User Authorization

The purpose of user authorization set up in the backend is for Upsolve AI to provide appropriate data access based on your user permissioning set up. In your product’s authentication flow, you register users with Upsolve using the project user registration flow. This flow separates three concerns:
  1. Register an organization — once per customer entity, via /register-organization.
  2. Register a user — once per user account, via /register-user.
  3. Fetch a user token — on every login / dashboard load, via /user-token.
The /user-token endpoint is a “refresh” endpoint that issues a short-lived (one-hour by default) JWT for a registered user. Call it every time you (re-)authorize the user in your app. This JWT is then used to provide your authorized users the appropriate access to the dashboard and underlying data.
To generate your API Key please go to the deploy page.
Here is an example of doing this using Clerk middleware. On every authenticated request we fetch a fresh user token, registering the user on first sign-in if /user-token reports they don’t exist yet:
middleware.ts

Setup Inspection

You could inspect whether the user authorization is setup successfully. Navigate to the Deploy application using the side navigation bar. upsolve-deploy If the endpoint is successfully called, you should see your new tenants in the Deploy application: tenants