In my case, I am handling the oauth code on the endpoint /api/monday/callback on my server. This endpoint exchanges the code for an access token. I have already implemented google oauth in a similar form and its working fine.
Reasons why we want to use OAuth instead of the other authentication mechanisms
We are adding a ‘Login using Monday.com’ (like login using google) feature in our app
We want our users to be able to create monday tasks from within our app. Currently this operation is happening from the server, so we need a token on our servers.
Ahh okay I see what you’re saying. Am I correct in assuming that you’re attempting to set up this OAuth flow in a preexisting app?
If so, am I correct in assuming that you’re attempting to change your Redirect_URL in your app draft to something different than what’s in your published app?
The reason I ask is because I was able to reproduce this behavior using ngrok, since ngrok issues a new URL each time you start it. This re-generated URL then, was different than the URL that is being used in my published app.
I’m asking our developers if there is a way around this, or if this is a bug. Thank you for your patience here, I’ll get back to you as soon as I hear from them!
Just heard back from our developer team. At this time, I’m afraid that we’re unable to issue different tokens for different OAuth settings (i.e. if you have a live app, you must utilize those OAuth settings).
If you’d like to change your OAuth settings then, you must first publish your app before you can see the effects of your OAuth changes.
Could this be the issue that you’re facing? I know that this makes testing OAuth flows a lot more difficult, so in this case I would set up a new App to test the OAuth flow before copying over to your live apps and publishing.