Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing Telegram login widget locally

I am currently developing an angular 9 website. I wanted to integrate Telegram Login to my website. I have done all the necessary steps to include it to the website. I have configured the domain name setting of the bot to my own. When deployed and in production, the website works perfectly well.

The problem arises when I try and debug it locally, the button raises "bot domain invalid" error. I am aware that this is because the website isn't hosted in the domain name the bot is configured to handle.

Solutions that I've tried using are

  • Use ngrok to proxy localhost to a public URL and set that as the bot's domain. This for some reason, which eludes me, won't work.
  • Since I'm developing in a windows environment, configure hosts file in windows to point my main domain name to localhost. This also hasn't worked, mysteriously.

Is there any other solutions that I can use to aid my use case?

I understand that I might not have implemented the solutions I mentioned above correctly. I will also appreciate it if I could get some decent pointers in those areas.

like image 451
Minasie Shibeshi Avatar asked Feb 04 '26 14:02

Minasie Shibeshi


1 Answers

You can test the telegram login widget locally if you:

  1. host your application on port 80
  2. access it with http://127.0.0.1 and not http://localhost

Check this link for details.

like image 142
lub0v Avatar answered Feb 06 '26 11:02

lub0v



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!