Closed mmartinortiz closed 6 years ago
Did you enter a bot token when you were asked for it?
I was not asked for a token, I just got the exception after I run the command
Edit:
I've tried using the token as a second argument after telegram
and as I expected it complains about "extra arguments"
That is unexpected. The telegram configure command definitely asks for a token: https://github.com/nextcloud/twofactor_gateway/blob/aa730883d763ab070c011ba505240d767fda5243/lib/Command/Configure.php#L157-L167
Interesting... the exception I get points to the line 150, and the function in the repository starts at line 157. I've checked both files (my local file and the one in the repo) and they are different.
Here is the diff:
102c102
< $providerQuestion = new Question('Please choose a SMS provider (websms, playsms, clockworksms): ', 'websms');
---
> $providerQuestion = new Question('Please choose a SMS provider (websms, playsms): ', 'websms');
139,149d138
< case 'clockworksms':
< $config->setProvider($provider);
< /** @var ClockworkSmsConfig $providerConfig */
< $providerConfig = $config->getProvider()->getConfig();
<
< $apitokenQuestion = new Question('Please enter your clockworksms api token: ');
< $apitoken = $helper->ask($input, $output, $apitokenQuestion);
<
< $providerConfig->setApiToken($apitoken);
<
< break;
169c158
< }
---
> }
\ No newline at end of file
I've disabled, removed and download the application again. The file I get installed is the same that I had previously. The appinfo/info.xml
file indicates that the version is 0.9.0, though.
<?xml version="1.0"?>
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>twofactor_gateway</id>
<name>Two-Factor Gateway</name>
<summary>Two-factor gateway providers (SMS, Telegram, Signal)</summary>
<description>A set of Nextcloud two-factor providers to send authentication codes via Signal, SMS and Telegram.</description>
<version>0.9.0</version>
<licence>agpl</licence>
<author>Christoph Wurst</author>
<namespace>TwoFactorGateway</namespace>
<category>security</category>
<website>https://github.com/nextcloud/twofactor_gateway</website>
<bugs>https://github.com/nextcloud/twofactor_gateway/issues</bugs>
<screenshot>https://raw.githubusercontent.com/ChristophWurst/twofactor_gateway/3f895bc997c1a3a38c9bae16ccae8bd499af864e/screenshots/settings.png</screenshot>
<screenshot>https://raw.githubusercontent.com/ChristophWurst/twofactor_gateway/3f895bc997c1a3a38c9bae16ccae8bd499af864e/screenshots/challenge.png</screenshot>
<dependencies>
<php min-version="7.0" max-version="7.2"/>
<nextcloud min-version="14" max-version="14"/>
</dependencies>
<two-factor-providers>
<provider>OCA\TwoFactorGateway\Provider\SignalProvider</provider>
<provider>OCA\TwoFactorGateway\Provider\SmsProvider</provider>
<provider>OCA\TwoFactorGateway\Provider\TelegramProvider</provider>
</two-factor-providers>
<commands>
<command>OCA\TwoFactorGateway\Command\Configure</command>
<command>OCA\TwoFactorGateway\Command\Status</command>
<command>OCA\TwoFactorGateway\Command\Test</command>
</commands>
<settings>
<personal>OCA\TwoFactorGateway\Settings\PersonalSettings</personal>
</settings>
</info>
How can I delete the applications cache? I want to make sure to force the the app to be downloaded again after I remove it.
Interesting... the exception I get points to the line 150, and the function in the repository star
Of course, because the master branch has change since the last release. You should be at this specific version: https://github.com/nextcloud/twofactor_gateway/blob/a5a7d4047ef80f485b81725fbca09afa6de20ea2/lib/Command/Configure.php#L146-L156.
Please don't change any files. If you do so and your installation breaks, you're on your own. I suggest to restore a backup with the previous state.
How can I delete the applications cache? I want to make sure to force the the app to be downloaded again after I remove it.
That functionality does not exist. You can try overwriting the app directory with the latest release tarball.
If the master branch contains a new development version I think it should have a different version number, like the 0.10.0 or just a 0.9.1-dev.
In any case, I've tried with sms
and signal
. In the case of signal I get a Using a localhost:5000
what I guess means that the argument is accepted. If I use sms
I get an exception:
TypeError: Argument 1 passed to OCA\TwoFactorGateway\Service\Gateway\SMS\Provider\WebSmsConfig::setUser() must be of the type string, null given, called in /config/www/nextcloud/apps/twofactor_gateway/lib/Command/Configure.php on line 118 and defined in /config/www/nextcloud/apps/twofactor_gateway/lib/Service/Gateway/SMS/Provider/WebSmsConfig.php:52```
If I use a wrong gateway, I get a proper error message:
Invalid gateway noway
Could the problem be originated by the class `Question`?
If the master branch contains a new development version I think it should have a different version number, like the 0.10.0 or just a 0.9.1-dev.
No, because we need the version bumps to trigger database migrations. Of course we could use even numbers for releases and odd ones for dev versions, but that breaks semver, which I'm a big fan of.
May I ask you what terminal you're using? Sounds like yours is not interactive and thus the questions are not asked. This is weird tbh.
I've checked the terminal. I'm using bash, but I forgot to use the -ti
parameters for docker (making it interactive). My fault :-\
Now I'm having the same problem described in this other issue, but I'll add information there.
Thanks for your help
Two-Factor Gateway: 0.9.0 Nextcloud: 14.0.2 RC1
I've followed the instructions of the admin documentation for setting up the two-factor authentification using telegram. My Nextcloud server runs in a docker container, so I run the
occ
command with the following command:It raises the following error:
Can I provide more useful information? I'm not sure how to proceed to getting 2FA working. (I did not try with other providers)