twofactor_gateway icon indicating copy to clipboard operation
twofactor_gateway copied to clipboard

Handle Telegram edge cases

Open ChristophWurst opened this issue 7 years ago • 9 comments

In order to stabilize the Telegram integration, it needs a few fixes in its gateway implementation that handle edge cases.

ChristophWurst avatar Aug 07 '18 05:08 ChristophWurst

Btw, @djpremier , see the new admin documentation for more info on how to set this up: https://github.com/nextcloud/twofactor_gateway/tree/master/doc/admin#telegram.

ChristophWurst avatar Aug 28 '18 11:08 ChristophWurst

Basically https://github.com/nextcloud/twofactor_gateway/blob/ce47ec9b6752b1ea46e1153e64b0c09c0e30da8f/lib/Service/Gateway/Telegram/Gateway.php#L90.

ChristophWurst avatar Aug 28 '18 12:08 ChristophWurst

Thanks Christoph, I already started the conversation with the button, in the case of '/start', and still I get the error.

djpremier avatar Aug 28 '18 12:08 djpremier

Now I'm on the computer, I can give you more details.

Following @ChristophWurst , the process was basically this:

I installed the app I have read the documentation I created the bot and started the conversation '/ start' I configured via 'occ' the gateway I went back to my settings panel and added my number I get the error in the same place and also in the log, as you can see in the screenshots

telegram gateway error telegram gateway error log

telegram gateway error bot

djpremier avatar Aug 28 '18 12:08 djpremier

and added my number

Did you enter your phone number or the chat id from the id bot?

ChristophWurst avatar Aug 28 '18 13:08 ChristophWurst

Phone number

djpremier avatar Aug 28 '18 15:08 djpremier

Get your ID via this bot and enter that is identifier.

ChristophWurst avatar Aug 28 '18 15:08 ChristophWurst

Thank you, it worked! But it is strange that you have placed the requested message to enter the phone number, since what should be placed is chat_id.

Another alternative is to send the message of / start and access:

https://api.telegram.org/bot<token>/getUpdates

There you will have access to id

I think it would be interesting if possible to mount this mini tutorial there in docs 😉

djpremier avatar Aug 28 '18 15:08 djpremier

Another alternative is to send the message of / start and access:

https://api.telegram.org/bot/getUpdates

That's exactly what this app does internally. But with that info alone, you have no mapping of Nextcloud and Telegram users. Users have to enter their chat id.

The steps will be documented in the UI starting with the next release. Ref #82.

ChristophWurst avatar Aug 28 '18 16:08 ChristophWurst