mirror of
https://github.com/nextcloud/twofactor_gateway.git
synced 2026-04-26 01:25:48 +03:00
[GH-ISSUE #359] clickatell question #84
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#84
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 @WeeseNXT on GitHub (Jul 2, 2020).
Original GitHub issue: https://github.com/nextcloud/twofactor_gateway/issues/359
So I have a clickatell account and have everything set up the way it needs to be but it ask me for my "central.clickatell.com" API, UN and Password, my issue is this is for accounts created prior to 2016. My account is at "portal.clickatell.com" can I make this app communicate with the new site instead? or do I have to have one of the old accounts?
@ChristophWurst commented on GitHub (Jul 3, 2020):
@killerbees19 can you help with this? (ref https://github.com/nextcloud/twofactor_gateway/pull/333)
@killerbees19 commented on GitHub (Jul 3, 2020):
Sadly I don't have an account at the new site yet. My credits are only available at the old site.
But I think it should be possible to create a 2nd provider for the new site. According to the docs the format differs only in one small part:
apiKeyinstead ofuser/password/api_id.@WeeseNXT Can you confirm this information? And would you test a patch for the new site? Maybe I could implement it, but I'm unable to test it by myself at the moment.
@killerbees19 commented on GitHub (Jul 3, 2020):
@WeeseNXT Please test PR #360
github.com/froonix/twofactor_gateway@c7cf85a04f.patchThanks!
@WeeseNXT commented on GitHub (Jul 3, 2020):
That is correct, yes. I would certainly be willing to test it but I am a noob to all of this, so forgive me if I need step by step instructions on the install or patch, etc. Thank you in advance for your reply.
@WeeseNXT commented on GitHub (Jul 3, 2020):
I'm on Nextcloud 19
Ubuntu server 18.04 LTS
Is there any relevant add-ons to nextcloud you would need to know about?
@killerbees19 commented on GitHub (Jul 3, 2020):
@WeeseNXT Do you know how to apply a patch/diff file? (And revert it if needed…)
@WeeseNXT commented on GitHub (Jul 3, 2020):
@killerbees19 I do not, I'm sorry.
@WeeseNXT commented on GitHub (Jul 4, 2020):
I apologize I'm new to all of this, trying to learn.
@killerbees19 commented on GitHub (Jul 4, 2020):
@WeeseNXT Do you have shell access (SSH) to your account at the server?
(To execute custom commands in the Nextcloud directory.)
@WeeseNXT commented on GitHub (Jul 5, 2020):
@killerbees19, Yes I do.
@WeeseNXT commented on GitHub (Jul 5, 2020):
It is my privately owned server at my house. I have 100% access to everything
@killerbees19 commented on GitHub (Jul 5, 2020):
Ok, then login to a shell with the right user, who's able to update Nextcloud files.
To remove the patch later:
Proceed with
occ twofactorauth:gateway:configure smsas usual. You should seeclickatellportalin the list.@WeeseNXT commented on GitHub (Jul 6, 2020):
@killerbees19
This is what it looks like.
root@myservernamehere:~# sudo nextcloud.occ twofactorauth:gateway:configure sms Please choose a SMS provider (websms, playsms, clockworksms, puzzelsms, ecallsms, voipms, huawei_e3531, spryng, sms77io, ovh, clickatellcentral, clickatellportal
When I type clickatellportal it returns
'Invalid provider clickatell portal'
I'm no coding expert as previously stated so excuse me if I sound silly, lol, but I did notice that 'clicksend' is missing from the end of the list as well as the ')' so I feel like some part of the code broke and part of the program is not communicating with the rest. All of the other providers return normal functions. To test my theory I also tried 'clicksend' it returns 'Invalid provider' as well.
@WeeseNXT commented on GitHub (Jul 6, 2020):
@killerbees19 commented on GitHub (Jul 6, 2020):
You're right, there's something wrong. I'll check that later and come back to you. Sorry! :-(
clicksendis missing because I've reformatted the patch to only include the changes between v016.0 release of the app andclickatellportalpatch.@killerbees19 commented on GitHub (Jul 6, 2020):
@WeeseNXT By bad, I forgot some lines while reformatting the patch…
Please revert/remove the old patch as mentioned before! :-)
Now try this one:
@WeeseNXT commented on GitHub (Jul 6, 2020):
@killerbees19, this one prompts me for the API key, but when I enter it, it just ends the program and sends me back to a normal command line prompt, does not prompt me for my UN and password. I did test it just to make sure the portal didn't ONLY need the api, no luck.
@killerbees19 commented on GitHub (Jul 6, 2020):
That's the expected behavior, it asks only for the API-Key. There's no username/password for the new API.
What's the output of
occ twofactorauth:gateway:status? It should display something like:Does it work on the command line?
Replace
YOURAPIKEYwith your API-Key andTESTRECIPIENTwith your own mobile phone number. What's the output of this command?(This command will cost you money!)
@killerbees19 commented on GitHub (Jul 6, 2020):
Ok, I've registered a new Clickatell account now and used the Test integration (Sandbox) feature. Works like a charm via Nextcloud. SMS code received at first try…
@WeeseNXT Are you sure you've created the right integration type? I think it's important to select One-way messaging at Messaging type.
The
fromargument at your example looks like you've setup two-way messaging.@WeeseNXT commented on GitHub (Jul 7, 2020):
Sorry I've taken so long to reply. Work has been a mess today (on a 24 hr shift on the ambulance).
In the US two way is required to send pages via sms according to clickatell and other sites I've read on. I've registered a return number on clickatell. It's throwing the error. "Invalid return number" I'm going to adjust some settings on my API integration and get back to you on what it says.
@WeeseNXT commented on GitHub (Jul 7, 2020):
So I have tested the curl call in command line, as I said two way is required in the US when I do the curl call in cmd line with my "from number" it works perfectly and I can send whatever page I would like, content wise. However, when I attempt the two-factor auth in Nextcloud, no luck. Is there a way for me to look at an error report? Nextcloud just states that it's been sent. It would see I just need a way to enter my "from number" into the program so It will be US compliant.
@killerbees19
@killerbees19 commented on GitHub (Jul 7, 2020):
@WeeseNXT Is there a link/source for this statement? :-)
I mean: It's possible to change the code and ask for a source number too. And just include it in the request, if not empty. But I'd only change it if it's really required.
btw: It seems like currently there's no error check for some plugins, including clickatellcentral and clickatellportal. So a failed request is silently ignored. I'll fix that later.
@WeeseNXT commented on GitHub (Jul 7, 2020):
@killerbees19 The other websites I tried have said the same thing. Clockwork requires you email customer service to even get an integration for the US. Since my server is small time they weren't willing to do it for me since it isnt a high volume business. I can get you the emails and more links if you require, but here is a screenshot from my integration.
@killerbees19 commented on GitHub (Jul 7, 2020):
Thanks for the screenshot! :-)
Ok, I'll look into this again later or tomorrow and prepare a new patch.
@killerbees19 commented on GitHub (Jul 8, 2020):
@WeeseNXT Sadly I can't test two-way messaging at Clickatell. But I think it should work now…
Please revert/remove the last patch again!
Now try this one:
occ twofactorauth:gateway:configure smsasks for a from number now:Please experiment with the format of mobile numbers. I think they should be in international format, without leading zeros or plus sign. (e.g.
436801234567890for Austria [43] and 6801234567890 as the mobile number)I've implemented a simple error check too, but the detailed error message will be hidden.
@ChristophWurst Any plans to log SmsTransmissionException messages? Currently it's impossible to see the details of failed HTTP requests without throwing other exceptions and breaking the user experience. Or am I missing something?
@WeeseNXT commented on GitHub (Jul 8, 2020):
I'm not sure what the deal is with this. Sorry, lol. I followed all of the steps and presumed it would work the exact same.
@WeeseNXT commented on GitHub (Jul 8, 2020):
That is where I remembered patching it to, to begin with. @killerbees19
@killerbees19 commented on GitHub (Jul 8, 2020):
@WeeseNXT Maybe you've rebootet in the meantime? Or there's a cleanup task for /tmp like tmpreaper.
However, just download the old patch again and then revert it:
(Please double-check the commands, I'm writing this at my smartphone! 🤐)
@WeeseNXT commented on GitHub (Jul 8, 2020):
@killerbees19, I did reboot, didn't realize that effected the patch. Learning more and more everyday. So I should just go from square one in that case?
@WeeseNXT commented on GitHub (Jul 8, 2020):
@killerbees19, since I'm a command-line noob and I kept getting errors. What I did was uninstall the two-factor gateway and associated apps and reinstalled it. Then, I applied your new patch following the instructions from scratch. It works like a charm. I just want to say I appreciate your willingness to teach and patch this program. Even though I couldn't offer any help as far as coding, etc. I hope that this will be applied to future editions and that this helped improve the app.
If you'd like me to test any future patches I would be willing to run some things on my server to test them, since it's small and mostly a hobby and extra storage for me. If I restart from here, it shouldn't have any effect on the current patch, right?
@killerbees19 commented on GitHub (Jul 9, 2020):
/tmp will be flushed at shutdown/reboot/boot 😉
Sometimes it's even a tmpfs (stored in RAM).
Thanks for the feedback and testing! I'll finish the PR, hopefully it'll be integrated into next release of this app.
The patch should stay available at your Nextcloud installation as long there's no update for the 2FA app. And as long as it's not uninstalled. But I'd recommend to download it and save it somewhere. (Outside of /tmp 😃)
@vitormattos commented on GitHub (Jun 28, 2022):
closed by #360