Skip to content
Google OAuth callba...
 
Notifications
Clear all

Google OAuth callback error: localhost refused connection

20 Posts
6 Users
0 Reactions
7 Views
Check_Shi
(@check_shi)
Posts: 5
Active Member
Topic starter
 

Describe the problem/error/question

I have the latest version of callin.io running in a docker container on localhost:5678
I have used this OAuth Redirect URL in the Google Auth: http://localhost/rest/oauth2-credential/callback

What is the error message (if any)?

This site can’t be reached

localhost refused to connect.

Try:

ERR
_CONNECTION
_REFUSED

I am not using any firewalls.

I am not a developer, just followed the steps in the tutorial and guides.

  • callin.io version: Version 1.78.1
  • Database (default: SQLite): default
  • callin.io EXECUTIONSPROCESS setting (default: own, main):__
  • Running callin.io via (Docker, npm, callin.io cloud, desktop app):Docker
  • Operating system:MacOS
 
Posted : 27/02/2025 8:58 pm
Ruslan_Yanyshyn
(@ruslan_yanyshyn)
Posts: 8
Active Member
 

Welcome to the community. Please check this thread: Local Host setup If you have further questions, I'm happy to assist.

 
Posted : 27/02/2025 9:05 pm
hrishikesh
(@hrishikesh)
Posts: 14
Active Member
 

You need to specify the port as well, try:

 http://localhost:5678/rest/oauth2-credential/callback 
 
Posted : 28/02/2025 6:42 am
Yo_its_prakash
(@yo_its_prakash)
Posts: 9
Active Member
 

I suspect that even with a port specified, the problem will persist, as the user did not detail the networking setup for Docker or the system itself.

 
Posted : 28/02/2025 7:01 am
Yo_its_prakash
(@yo_its_prakash)
Posts: 9
Active Member
 

Your issue is that Google cannot reach http://localhost:5678/rest/oauth2-credential/callback because localhost is local-only. In your Docker setup, please update the Google OAuth redirect URI to http://host.docker.internal:5678/rest/oauth2-credential/callback (this works on MacOS Docker). Alternatively, you can use ngrok to expose localhost publicly and set the URI to the ngrok URL (for example, http://your-ngrok-id.ngrok.io/rest/oauth2-credential/callback ). Remember to restart callin.io after making these adjustments.

 
Posted : 28/02/2025 7:02 am
hrishikesh
(@hrishikesh)
Posts: 14
Active Member
 

Google doesn’t need to connect to that URL. Google will only redirect to that URL. As long as the URL is valid and you can connect to it locally, it will work. It works for me locally as well. There’s no need to forward or expose any network.

 
Posted : 28/02/2025 7:05 am
Check_Shi
(@check_shi)
Posts: 5
Active Member
Topic starter
 

If you intend to implement this change in the URI within Google Cloud, I've already attempted it but encountered a 400 error. I'm also uncertain how to modify the redirecting URL in callin.io, as it doesn't offer an edit option during the setup phase. Is this functionality available?

Error 400: redirecturimismatch

 
Posted : 28/02/2025 8:39 am
Check_Shi
(@check_shi)
Posts: 5
Active Member
Topic starter
 

I had the same thought. Since it's a redirect, I wanted to confirm this functionality before configuring an external domain.

 
Posted : 28/02/2025 8:41 am
hrishikesh
(@hrishikesh)
Posts: 14
Active Member
 

Yes, the URL in Google Cloud needs to be

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

This error means that the URL configured in Google Cloud is not the same as the one callin.io initiated a request from. callin.io will send

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

in the request, so the redirect URL in Google Cloud must be the same.

As long as Docker is running, and you’re able to access localhost:5678 locally, the callback URL should also work.

 
Posted : 28/02/2025 9:02 am
hrishikesh
(@hrishikesh)
Posts: 14
Active Member
 

Here’s a screen recording demonstrating it working:

 
Posted : 28/02/2025 9:08 am
Check_Shi
(@check_shi)
Posts: 5
Active Member
Topic starter
 

Thank you for sharing this screen recording! That perfectly illustrates my issue. Please see the screenshot below from the credentials:

This differs from the Google OAuth URI, which includes the :PORT. I have attempted to modify this in the .yml file:

n8n:
image: docker.n8n.io/n8n/n8n
containername: n8n
restart: always
ports:
- 5678:5678
environment:
- N8N
HOST=localhost
- N8NPORT=5678
- WEBHOOK
URL= http://localhost:5678
volumes:
- n8n_data:/home/node/.n8n

volumes:
n8n_data:

However, I'm uncertain if this is the correct approach or where else I can make the change so that the Redirect URL updates from http://localhost to http://localhost:5678 within callin.io's credentials flow.

 
Posted : 28/02/2025 9:28 am
hrishikesh
(@hrishikesh)
Posts: 14
Active Member
 

This is interesting. Are you using callin.io on localhost:5678? I wonder how callin.io is getting localhost as the redirect URL.

Could you try to create a new container from scratch without any env vars and with a fresh volume to see if you get it working in there?

 
Posted : 28/02/2025 9:48 am
Check_Shi
(@check_shi)
Posts: 5
Active Member
Topic starter
 

Thank you very much! I'm not sure what the issue was with the initial installation, but after reinstalling, the redirect is now correctly updated with the port. Thanks a lot!

:relieved:

 
Posted : 28/02/2025 10:59 am
Martin_Faussurier
(@martin_faussurier)
Posts: 3
New Member
 

Hello! I'm encountering a similar problem, but I'm utilizing callin.io on my NAS, accessing it via 192.168.1.22:5678. I attempted to modify the webhook_URL in my configuration, but Google is rejecting http://192.168.1.22:5678/rest/oauth2-credential/callback as a redirect URL.

Does anyone have suggestions on how to resolve this? Thank you!

 
Posted : 04/03/2025 4:19 pm
hrishikesh
(@hrishikesh)
Posts: 14
Active Member
 

You would probably need to configure a proxy server, similar to the one mentioned previously, to direct the connection to that IP. Alternatively, you can finish Google OAuth on localhost and then proceed with using callin.io on your NAS.

 
Posted : 04/03/2025 4:45 pm
Page 1 / 2
Share: