Oauth 2 Not Working

Hello, I’m creating this topic following Ricardo’s words on this topic : Google Analytics API

I’m having troubles connecting to Oauth 2 for Google APIs currently. I set up all the connection based on your documentation, but at the end I always have the same error message : “{“code”:404,“message”:“The requested webhook “GET rest/oauth2-credential/callback” is not registered.”,“stack”:“ResponseError: The requested webhook “GET rest/oauth2-credential/callback” is not registered.\n at ActiveWorkflowRunner.executeWebhook (/usr/local/lib/node_modules/n8n/dist/src/ActiveWorkflowRunner.js:55:19)\n at async /usr/local/lib/node_modules/n8n/dist/src/Server.js:1084:28”}”

My ops team have secured our hosted n8n by filtering IP addresses so that only the IP address of our company can access it. Do you think the problem could be that, preventing Google to send the callback?

If you think it could be that, what should we do? Allow all possible Google IP addresses? Or tell to my ops team to find another way to secure our hosted n8n?

Thanks,
Have a great day!

That error message sounds wrong.

The callback URL should be something like:

http://localhost:5678/rest/oauth2-credential/callback

but according to the error message does it sound like you are using something like:

http://localhost:5678/webhook/rest/oauth2-credential/callback

(so for some reason did /webhook end up in there)

Thanks Jan, I’m going to see with my ops team if this is linked with the way they set it up.

Great. Btw. it should display you automatically the correct URL in the credential you did create, if you click on “OAuth Callback URL”:

Well actually it shows me the one with the /webhook :

Then you have probably configured n8n incorrectly.

Initial guess would be that you did either:

or

  • N8N_PATH got set to “webhook/” which should have actually stayed at its default value of “/”.

Thanks a lot, we fixed this and it worked!

Have a good day,

Great to hear! Have fun!