Kirill Gromov Posted September 29, 2023 Share Posted September 29, 2023 View File Telegram Login Handler The application will add the ability to set up authorization on your community using the Telegram bot. To configure you need to create a bot and assign community url address. Submitter Kirill Gromov Submitted 09/02/23 Category Applications Имя Quote Link to comment Share on other sites More sharing options...
kmk Posted February 11 Share Posted February 11 Hi, I would like to donwload this file. Имя Quote Link to comment Share on other sites More sharing options...
Brian Posted October 2 Share Posted October 2 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 . Имя Quote Link to comment Share on other sites More sharing options...
Kirill Gromov Posted October 2 Author Share Posted October 2 1 hour ago, Brian said: 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 . Hello, Can you check the PHP error logs? Имя Quote Link to comment Share on other sites More sharing options...
Brian Posted October 2 Share Posted October 2 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 Имя Quote Link to comment Share on other sites More sharing options...
Brian Posted October 2 Share Posted October 2 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 Имя Quote Link to comment Share on other sites More sharing options...
Brian Posted October 2 Share Posted October 2 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'); } Имя Quote Link to comment Share on other sites More sharing options...
Brian Posted October 2 Share Posted October 2 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 . Имя Quote Link to comment Share on other sites More sharing options...
Kirill Gromov Posted October 3 Author Share Posted October 3 A new version with fixes is now available! 1 Имя Quote Link to comment Share on other sites More sharing options...
Brian Posted October 3 Share Posted October 3 uninstalled , disconnected in telegram and terminated in telegram authorization . Nothing changed . the error looks same and all . Имя Quote Link to comment Share on other sites More sharing options...
Brian Posted October 3 Share Posted October 3 maybe it has something to do with changelog version not matching the update version . Имя Quote Link to comment Share on other sites More sharing options...
Kirill Gromov Posted October 4 Author Share Posted October 4 10 hours ago, Brian said: uninstalled , disconnected in telegram and terminated in telegram authorization . Nothing changed . the error looks same and all . Hello. You can try to link your telegram account here on this site. Will you get an error? Имя Quote Link to comment Share on other sites More sharing options...
Brian Posted October 4 Share Posted October 4 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 . my site as soon as i click this button i get the Not from telegram error . 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 . Имя Quote Link to comment Share on other sites More sharing options...
Brian Posted October 4 Share Posted October 4 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 ? Имя Quote Link to comment Share on other sites More sharing options...
Kirill Gromov Posted October 4 Author Share Posted October 4 It seems I didn't make any changes to the last version I uploaded. I updated the version, it should work now. 1 Имя Quote Link to comment Share on other sites More sharing options...
Brian Posted October 4 Share Posted October 4 thank you thank you ! works 1 Имя Quote Link to comment Share on other sites More sharing options...
sman Posted October 8 Share Posted October 8 now it works, but there are tons of errors in logs Please take a look Имя Quote Link to comment Share on other sites More sharing options...
Kirill Gromov Posted October 9 Author Share Posted October 9 8 hours ago, sman said: now it works, but there are tons of errors in logs Please take a look Hello. Can you provide an example of a log? Имя Quote Link to comment Share on other sites More sharing options...
sman Posted October 10 Share Posted October 10 I've cleaned everything, but when I have a new logs I'll post it here. thanks for attention Имя Quote Link to comment Share on other sites More sharing options...
sman Posted October 11 Share Posted October 11 Sorry, I confused with VK login handler. Telegram works well! Имя Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.