nextcloud / twofactor_gateway

🔑 Second factor provider using an external messaging gateway (SMS, Telegram, Signal)
GNU Affero General Public License v3.0
109 stars 62 forks source link

Add SMS Central (Australia) gateway support #209

Open Ekwok95 opened 5 years ago

Ekwok95 commented 5 years ago

Hello, I would like to add a new SMS gateway to this application. What should I do in order to achieve this?

ChristophWurst commented 5 years ago

How custom is it? Did you write it yourself?

If it's usable for other users as well I'd suggest to add this as new SMS gateway implementation. Otherwise you'll probably have to fork this app and adjust it there.

Ekwok95 commented 5 years ago

I see. In that case I would like for the SMS gateway SMS Central (Australia) to be added as an SMS gateway implementation. This SMS gateway was not written by me but due to the limited options not being able to work for Australian numbers, I needed to find a way to add this option into this application. Apologies for not being specific with my request.

ChristophWurst commented 5 years ago

Then I'd suggest we add this to our code base :)

Have a look at PRs like https://github.com/nextcloud/twofactor_gateway/pull/185 and https://github.com/nextcloud/twofactor_gateway/pull/169. I think it should be clear about what you have to change. Once you have some code please open a pull request and I can help you put the code into shape :)

Ekwok95 commented 5 years ago

Cool thanks. I'll get started on this.

Ekwok95 commented 5 years ago

Hey Chris, for the Config.php file for the provider, and the provider.php files seem like they are taking in values for API POST requests. Am I right? According to SMSCentral API documentation, it seems that 5 type of values are needed to be sent to the URL for the API calls. I'm not sure where to include these values in those 2 files.

The 5 parameters are as follows:

Ekwok95 commented 5 years ago

Also, this is the first time I've used Github to commit code to someone else's application. How do I upload the code here or send it here for review?

ChristophWurst commented 5 years ago

Looks like username and password go into the provider config class, action is static and recipient and text get passed into the gateway just like with the other implementations.

The workflow is that you create your fork, create a new branch, commit to that branch, push it back to github and open a pull request here. I think this is well documented on GitHub's help pages: https://help.github.com/en/articles/creating-a-pull-request-from-a-fork