twilio / authy-devise

Authy Devise plugin to add Two-Factor Authentication
MIT License
201 stars 84 forks source link

AUTHY-WITH-QR-CODE #147

Closed thisaliahmad closed 3 years ago

thisaliahmad commented 4 years ago

I am working on authy-devise with the user, and active admin both, I want the user to on two-factor authentication with QR code. it's showing my error undefined qr_code when I enter config.authy_enable_qr_code = true in devise.rb. and how i will get QR code in html on my custom view. help needed!

philnash commented 4 years ago

Have you enabled Generic authenticator tokens in your Authy Application settings in the Twilio console? What version of authy-devise are you using?

In a custom view you should have access to a @authy_qr_code instance variable that contains the URL to a QR code image.

thisaliahmad commented 4 years ago

yes, my QR is enabled on Twilio! am using devise-authy (2.2.0) gem and when I use @authy_qr_code its show me the error of undefined, as config.authy_enable_qr_code = true in devise.rb also generates Error.

philnash commented 4 years ago

What is the error that you see generated when you enable config.authy_enable_qr_code = true? Can you paste the stack trace here, please?

philnash commented 4 years ago

I just created an ActiveAdmin application with DeviseAuthy and turned QR codes on in devise.rb and it worked for me.

I was seeing errors when I did not have Generic authenticator tokens enabled for my Authy application.

Can you double check that for the Authy application that you are working with (that you have the API key for) that Generic authenticator tokens are enabled in the settings. Note: once you flip the switch in the settings, you need to save the application, otherwise it won't be saved.

thisaliahmad commented 4 years ago

if you upload your application where you integrate authy with active admin it will be great help for me to learn it.

thisaliahmad commented 4 years ago

I have saved country code and phone numbers in my database, I applied two-factor-authentication from them, for that, I over-ride the POST_enable_authy method with superclass Devise::DeviseAuthyController (custom authy controller) for both admin_users and users now am getting the error of superclass mismatch any solution for this?

philnash commented 4 years ago

Can you post the full stack trace please? I will try to reproduce.

philnash commented 3 years ago

Hey @thisaliahmad, can you share the stack trace so I can see what's going on here? Thanks!

philnash commented 3 years ago

I'm going to close this issue, but if you're still having issues, please re-open it with more details.

Thanks!