Hi everyone,
I’m building a full-stack app using monday code (React UI + Express backend) and I want to make sure I’m following the correct authentication and authorization best practices.
Current architecture
UI → Backend authentication
-
From the UI, I fetch
monday.get("sessionToken") -
I send it to my backend in a request header
-
In the backend, I verify/decode the
sessionTokenusing myclient_secret -
This works well for validating that the request comes from monday and from my app
When decoding the sessionToken JWT, I noticed that it does not include a short-lived token that can be used to call monday APIs.
OAuth & monday API calls
-
I implemented a standard OAuth flow
-
In the OAuth callback, I store the returned OAuth access token in Secure Storage
-
When calling monday APIs from the backend, I retrieve that token and use it like this:
import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: accessToken });
const query = ` query { custom_activity { color icon_id id name type } } `;
const response = await mondayApiClient.request(query);The concern
Since the backend uses the app’s OAuth access token, API calls are executed with the permissions granted to the app, not necessarily the permissions of the current user interacting with the UI.
This means a user could potentially trigger backend endpoints that:
-
Perform actions they personally don’t have permission for
-
For example: updating an item, creating updates, modifying board data, etc.
I want to ensure my app design aligns with monday’s security model and recommended approach.
Thanks in advance for any guidance 🙏
