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:- Register an organization — once per customer entity, via
/register-organization. - Register a user — once per user account, via
/register-user. - Fetch a user token — on every login / dashboard load, via
/user-token.
/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.
Example: Registering users with Clerk middleware
Example: Registering users with Clerk middleware
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.
