Comments (7)
Thanks for the translation, it's great to see everyone's involvement from all over the world!
Regarding implementing a new gateway, have a look at the Twilio gateway, and most notably the interface of the gateway class. If you implement a class with the signature shown below, it's enough. Depending on how phone calls are made, you might need to wire some Django views and urls, as is also shown in the Twilio gateway. Finally, you can also have a look at the "fake gateway", which also shows an implementation of the gateway.
class MyGateway(object):
def make_call(self, device, token):
raise NotImplementedError()
def send_sms(self, device, token):
raise NotImplementedError()
Sadly I'm not traveling to DjangoCon this round, but would love to visit some year in the future. Have a great week!
from django-two-factor-auth.
If you have any additional questions, please let me know :).
from django-two-factor-auth.
Hello again @Bouke :)
I've worked on fake.py and sms is now getting sent and working perfectly.
How do i show you my work? paste here or add you to the fork i did to review before submitting pull request?
I based fake.py on another django app which made it work within minutes!
from django-two-factor-auth.
and I believe i need help in testing what i did?
from django-two-factor-auth.
For reviewing your code, you could post it here. I'm not very inclined to add extra gateways, as the burden of supporting it and updating it with API changes would also be mine.
from django-two-factor-auth.
@Bouke actually its a complete ready app so maintaining it is not going to be handled by django-two-factor-auth but django-nexmo
What I did is installed django-nexmo and updated fake.py to the following:
from nexmo import send_message
class Fake(object):
@staticmethod
def send_sms(device, token):
send_message(device.number,'Your token is: %s' % token)
and worked, my next addition is to have django-nexmo supports voice then would add another staticmedhod for make_call to call since Nexmo supports voice too.
from django-two-factor-auth.
That looks like a nice and simple solution. However you could consider renaming the class to NexmoGateway
instead of Fake
, but looks great otherwise.
from django-two-factor-auth.
Related Issues (20)
- computing phone method availability is done in different places using different criteria
- Is it possible to use django-two-factor-auth with django-rest-knox? Is there a guide somewhere? HOT 1
- Feature request: Setting to disable `two_factor` in dev HOT 2
- 'two_factor' is not a registered tag library HOT 2
- Feature: Enable Whatsapp as a method
- Feature request: Norwegian Bokmål (nb) Language HOT 1
- Django-otp 1.3.0 broke tests HOT 3
- Cookie validation raises BadSignature error after major Django upgrade HOT 1
- drf-spectacular does not show APIs HOT 3
- Two factor not working with django-auth-adfs
- Is there a migration guide for 1.15? HOT 2
- 'RemoteYubikeyDevice' object has no attribute 'throttle_reset'
- What is needed to upgrade to webauthn 2.0.0+? HOT 1
- Authenticating with backup token should remove token step from final form list HOT 1
- Feature request: Add support for using Twilio Verify instead of Twilio Messaging HOT 1
- Question: Is it possible to implement 2FA only for a specific site when you have multiple independent admin sites in django admin? HOT 2
- cannot import name 'is_safe_url' HOT 1
- Unhandled exception HOT 5
- Is it possible to extend the user model? HOT 2
- How to subclass AuthenticationTokenView and use it in a subclassed LoginView HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-two-factor-auth.