Server-side OAuth flow

Hello everyone,

I’m looking for help with the OAuth flow. My front-end is hosted on the CDN, and my back-end is hosted on my server. When I use get(“sessionToken”) on the front-end and try to use the token on the back-end setToken(TOKEN), I get an error saying “Not Authenticated”.

What is the best way to obtain a user token for the back-end?

Thank you in advance for your help. I appreciate any guidance or suggestions you can offer.

Hello @kulaone,

I don’t think you can use the token obtained from your frontend app on the backend. To make changes on a board through the backend, you will have to use a different form of authentication.
Here is the documentation on that.

Hello @kulaone,

Was that the information you were looking for?

Thank you @kolaai !!!

I don’t think so. I’m looking for a long-term access token for a BE of a board view app.
The doc @kolaai mention is about Authorization for integration recipes.
Are there any way to send the authorization calls from the FE without using a integration recipes?

The only solution I’ve found is to use the QAuth flow. However, it doesn’t seem logical or user friendly, for a user who is already logged in to monday to be redirected to the authorization page from the board and then redirected to the BE that will redirect the user back to monday, to the same board view (or item view).
What I really need is for my FE to get the authorization code, sends it to the BE, then the BE will use it to get the long-term access token.

Hello again,

In this case I believe you will need to use OAuth. It is the only way for you to get a permanent access token you can use in your backend.