mirror of
https://github.com/nextcloud/twofactor_gateway.git
synced 2026-04-25 17:15:53 +03:00
[GH-ISSUE #301] Telegram verification fails: Wrong parameters for OCA #68
Labels
No labels
0. to triage
1. to develop
3. to review
blocked
bug
discussion
duplicate
enhancement
enhancement
gateway:signal
gateway:signal
gateway:signal
gateway:sms
gateway:telegram
hacktoberfest
help wanted
invalid
needs info
php
pull-request
question
technical debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/twofactor_gateway-nextcloud#68
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vasyugan on GitHub (Dec 11, 2019).
Original GitHub issue: https://github.com/nextcloud/twofactor_gateway/issues/301
I have registered a telegram bot as described in the instructions and configured it. Now, when I try to go through the verification process in my user account, I understand one first has to input one's phone number as it is known to Telegram:
+[country code][phone number without leading 0]
When I do that, the app says: "Could not verify your code. Please try again."
The log says:
{"reqId":"YkguFAJJFEP0cdhHVNKw","level":3,"time":"2019-12-11T08:25:23+00:00","remoteAddr":"2003:d3:c733:5400::c0d","user":"jr","app":"index","method":"POST","url":"\/apps\/twofactor_gateway\/settings\/telegram\/verification\/start","message":{"Exception":"Exception","Message":"Wrong parameters for OCA\\TwoFactorGateway\\Exception\\SmsTransmissionException([string $message [, long $code [, Throwable $previous = NULL]]])","Code":0,"Trace":[{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/lib\/private\/AppFramework\/App.php","line":126,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\TwoFactorGateway\\Controller\\SettingsController"},"startVerification"]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\TwoFactorGateway\\Controller\\SettingsController","startVerification",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"gateway":"telegram","_route":"twofactor_gateway.settings.startVerification"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"gateway":"telegram","_route":"twofactor_gateway.settings.startVerification"}]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"gateway":"telegram","_route":"twofactor_gateway.settings.startVerification"}]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/lib\/base.php","line":1000,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/apps\/twofactor_gateway\/settings\/telegram\/verification\/start"]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"\/var\/www\/htdocs\/cloud.xxx.xxx\/lib\/private\/AppFramework\/Http\/Dispatcher.php","Line":109,"Previous":{"Exception":"Error","Message":"Wrong parameters for OCA\\TwoFactorGateway\\Exception\\SmsTransmissionException([string $message [, long $code [, Throwable $previous = NULL]]])","Code":0,"Trace":[{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/apps\/twofactor_gateway\/lib\/Service\/Gateway\/Telegram\/Gateway.php","line":86,"function":"__construct","class":"Exception","type":"->","args":[{"__class__":"Telegram\\Bot\\Exceptions\\TelegramResponseException"}]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/apps\/twofactor_gateway\/lib\/Service\/SetupService.php","line":92,"function":"send","class":"OCA\\TwoFactorGateway\\Service\\Gateway\\Telegram\\Gateway","type":"->","args":[{"__class__":"OC\\User\\User"},"+4915792331634","282163 is your Nextcloud verification code."]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/apps\/twofactor_gateway\/lib\/Controller\/SettingsController.php","line":90,"function":"startSetup","class":"OCA\\TwoFactorGateway\\Service\\SetupService","type":"->","args":[{"__class__":"OC\\User\\User"},"telegram","+4915792331634"]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":170,"function":"startVerification","class":"OCA\\TwoFactorGateway\\Controller\\SettingsController","type":"->","args":["telegram","+4915792331634"]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\TwoFactorGateway\\Controller\\SettingsController"},"startVerification"]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/lib\/private\/AppFramework\/App.php","line":126,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\TwoFactorGateway\\Controller\\SettingsController"},"startVerification"]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\TwoFactorGateway\\Controller\\SettingsController","startVerification",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"gateway":"telegram","_route":"twofactor_gateway.settings.startVerification"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"gateway":"telegram","_route":"twofactor_gateway.settings.startVerification"}]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"gateway":"telegram","_route":"twofactor_gateway.settings.startVerification"}]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/lib\/base.php","line":1000,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/apps\/twofactor_gateway\/settings\/telegram\/verification\/start"]},{"file":"\/var\/www\/htdocs\/cloud.xxx.xxx\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"\/var\/www\/htdocs\/cloud.xxx.xxx\/apps\/twofactor_gateway\/lib\/Service\/Gateway\/Telegram\/Gateway.php","Line":86},"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:71.0) Gecko\/20100101 Firefox\/71.0","version":"17.0.1.1"}@ChristophWurst commented on GitHub (Dec 11, 2019):
Caused by line
github.com/nextcloud/twofactor_gateway@c7a23e6eb7/lib/Service/Gateway/Telegram/Gateway.php (L86).In any case, there exception is logged one line above. Check your nextcloud.log. Every time this error occurs there should be two new lines.
@vasyugan commented on GitHub (Dec 11, 2019):
I don't know if this is what you are looking for?
@vasyugan commented on GitHub (Dec 11, 2019):
Or maybe this one, where it repeatedly says "chat not found"
@ChristophWurst commented on GitHub (Dec 11, 2019):
Yes, that one.
@ChristophWurst commented on GitHub (Dec 11, 2019):
Did you start a conversation with the bot?
@ChristophWurst commented on GitHub (Dec 11, 2019):
Oh. and you're not supposed to enter your phone number for Telegram but the chat ID.
@ChristophWurst commented on GitHub (Dec 11, 2019):
See https://github.com/nextcloud/twofactor_gateway/blob/master/doc/User%20Documentation.md#telegram
@vasyugan commented on GitHub (Dec 11, 2019):
Then the interface should be fixed. It says: "Enter your identification (e.g. phone number to start the verification):"
@vasyugan commented on GitHub (Dec 11, 2019):
I guess a direct link to the id bot would be helpful. I guess the instructions could be clearer. It should instruct the user to talk to @my_id_bot (because you get many his when you look for "id bot" in Telegram) and then enter the obtained ID into the box. Also, is it possible to display the name of the Nextcloud telegram bot? I guess is should be obtainable, after all, Nextcloud does talk to Telegram, once it has the token.
@ChristophWurst commented on GitHub (Dec 12, 2019):
There was an attempt to improve this at https://github.com/nextcloud/twofactor_gateway/pull/133.
👍 on making it a link
The "Enter your …" is a generic text shown for every gateway type (sms, signal, telegram). Maybe we should remove the "(e.g. …)" part then it's more fitting for every gateway.
@noplanman commented on GitHub (Mar 18, 2020):
Just ran into this as I forgot to update the API key after resetting it.
Would be great to give a more useful error message, as it took a while for me to realise what was wrong.