Skip to content
View in the app

A better way to browse. Learn more.

Invision Developers

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
New Invision Marketplace

Telegram Login Handler

Featured Replies

allows me to login but on redirect it shows this

i get 2 confirmations in telegram that someone is login ( me )  then this in browser .

Screenshot2024-10-02at12-19-38Error.png.f3c623fd285deb2cc37c0e8d0c2ca337.png

No errors in php.log

log_errors is on

error_reporting is set to   E_ALL & ~E_DEPRECATED & ~E_STRICT

is the script php 8.1.29 compatible ?

the system log in ips shows

 

Screenshot2024-10-02at16-09-19SystemLogs.thumb.png.719ffb9e2a14dee26550927b2f76141a.png

 

i have noticed that the return url has a shortened version of telegram domain .

could it be that the  t.me domain was not being used when you wrote the script.

i can see the error above says "data is not from telegram"

photo_url=https%3A%2F%2Ft.me%2Fi%2Fuserpic%2F320%2FMoFrm-TfM-t5q9_removedforsafgetyg14zL6Kxxx01JPc.jpg

 

 

i dont know exactly how to read this line of code in  auth.php but it would seem that the  "data not from telegram" error

comes from this line because

something is not egual to 0
 

  if (strcmp($hash, \IPS\Request::i()->hash) !== 0) {

    throw new Exception('Data is NOT from Telegram');
  }

 

commented out those 3 lines and it logs in fine ..

but im sure this is to keep someone from faking the telegram login from another site .

so i will disable till i hear how to fix .

 

 

uninstalled , disconnected in telegram and terminated in telegram authorization .

Nothing changed .   the error looks same and all .

 

 

 

maybe it has something to do with changelog version not matching the update version .

 

2024-10-03_13h44_47.png.17603653e7b65a9c02af9399b7c8991d.png

makes no sense . i can login on your site . the steps are exactly same as mine . except on mine i get the NOT from telegram error .

Screenshot_20241004_073302_Samsungcapture.thumb.jpg.8a43a2dfe8f01bd02a7e56c8468b253a.jpg

Screenshot_20241004_073421_Samsungcapture.thumb.jpg.a1d660ef55392558b1efaf0d04bf914d.jpg

 

my site

 

Screenshot_20241004_085021_Samsungcapture.thumb.jpg.273ba86580f716b22a80746dc8f6bacd.jpg

 

Screenshot_20241004_084650_Samsungcapture.thumb.jpg.1e682b1d90aeaa312825f373f59323aa.jpg

 

Screenshot_20241004_085201_Samsungcapture.thumb.jpg.d5b316d39551a2e1f24486225bc34a7f.jpg

 

Screenshot_20241004_084814_Samsungcapture.thumb.jpg.bfa6a60d769aa681f2ce0349397b08f4.jpg

 

SmartSelect_20241004_085357_Chrome.thumb.jpg.c837e4918a4aadbfc77ee3bd61b339f8.jpg

 

as soon as i click this button i get the Not from telegram error .

 

SmartSelect_20241004_085423_Chrome.thumb.jpg.39ea43e44a6f1f278eb92990de5c0a5c.jpg

 

the link in the address bar at that point looks like .

 

https://subdomain.mydomain.com/applications/telegramlogin/interface/telegram/auth.php?key=16783efwertyuiopasd31a71be03f123&id=3819612530&first_name=Brian&last_name=Correll&username=telegramusername&photo_url=https%3A%2F%2Ft.me%2Fi%2Fuserpic%2F320%2FMoFrm-TfM-t5q9_rDXAeWYZg14zL6K3mj7FSIA01JPc.jpg&auth_date=1728047208&hash=dafa2940c12973b93594ec4c32876dd1c2b2d1769b2ab347a1cec69ad1b57a09

 

not sure what it could be . 

like i say removing those 3 lines from auth.php makes it work .

 

i made a small change to your code just to see what was stored in the

2 vars

  sort($data_check_arr);
  $data_check_string = implode("\n", $data_check_arr);
  $secret_key = hash('sha256', $settings['client_secret'], true);
  $hash = hash_hmac('sha256', $data_check_string, $secret_key);
$testme = \IPS\Request::i()->hash;

  if (strcmp($hash, \IPS\Request::i()->hash) !== 0) {
	throw new Exception('Data is NOT from Telegram '.$hash.' '.$testme);
  }

added the $testme  var

and when the exception is thrown added  $hash and $testme so i could see them in the error

this is whats shown in the system log

Exception: Data is NOT from Telegram 00713a13bc63fb81577484714b875af936cdd89c0132fd2282a6f2bd1de6d882 a03990d9bedb6a2ee429751de8b1ca84d1024300b242873287d00eb7ece7a459 (0)
#0 C:\ips\applications\telegramlogin\interface\telegram\auth.php(25): checkTelegramAuthorization()
#1 {main}

 

very different strings .

 

any ideas ?

 

now it works, but there are tons of errors in logs 

Please take a look

I've cleaned everything, but when I have a new logs I'll post it here. thanks for attention

Sorry, I confused with VK login handler. Telegram works well!

seems there are some errors:

image.thumb.png.11bfc18eeffcc18e2daf092b8677cc9e.png

Quote

#0 /var/www/html/system/Theme/Theme.php(861): IPS\_Log::log()
#1 /var/www/html/applications/telegramlogin/sources/TelegramLogin/TelegramLogin.php(66): IPS\_Theme->getTemplate()
#2 /var/www/html/system/Theme/Theme.php(885) : eval()'d code(10365): IPS\telegramlogin\_TelegramLogin->button()
#3 /var/www/html/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_core_front_global->loginPopup()
#4 /var/www/html/system/Theme/Theme.php(885) : eval()'d code(21711): IPS\Theme\_SandboxedTemplate->__call()
#5 /var/www/html/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_core_front_global->userBar()
#6 /var/www/html/system/Theme/Theme.php(885) : eval()'d code(8086): IPS\Theme\_SandboxedTemplate->__call()
#7 /var/www/html/system/Theme/SandboxedTemplate.php(61): IPS\Theme\class_core_front_global->globalTemplate()
#8 /var/www/html/system/Output/Output.php(770): IPS\Theme\_SandboxedTemplate->__call()
#9 /var/www/html/init.php(940) : eval()'d code(26): IPS\_Output->error()
#10 /var/www/html/system/Dispatcher/Front.php(127): IPS\cms_hook_Output->error()
#11 /var/www/html/init.php(940) : eval()'d code(23): IPS\Dispatcher\_Front->init()
#12 /var/www/html/system/Dispatcher/Dispatcher.php(110): IPS\Dispatcher\stickynotes_hook_Outputs->init()
#13 /var/www/html/index.php(13): IPS\_Dispatcher::i()
#14 {main}

and i have a lot of them:

image.thumb.png.072edbf778d6ad1add5c16e0bc9076ea.png

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.