Securing API's with Multi Factor Authentication

Adi*_*lik 6 django restful-architecture two-factor-authentication django-rest-framework multi-factor-authentication

I want to secure my API with Multi-factor-Authentication on top of Auth Token/JWT. I have been searching but couldn't find any package that can work with drf. I am thinking to write my own django app. Any comments on what should be the architecture ?

我想到的一个解决方案是引入令牌基础架构。如果用户正在访问受 mfa 保护的 api,那么请求实例应该与令牌一起保存,并且应该向他的手机发送一条短信(如果手机作为 mfa ) 并且响应应该是那个标记。然后应该向mfa端点发出另一个请求token and mfa-code。一旦验证,我们将获取他之前的请求对象并完成请求。