Coder Social home page Coder Social logo

Comments (6)

antonioribeiro avatar antonioribeiro commented on May 27, 2024 4

I store them in the database, encrypted, in the users table, using a json column (backup_codes). Storing 8 codes would take around 200 chars, I don't thing this is too big.

There's this issue which goes a little in the workflow: antonioribeiro/google2fa#85 (comment)

I think it's pretty straightforward:

Register or Logged in
User asks to enable 2FA
Show 2FA qr-code
Show 2FA backup codes
Test the 2FA qr-code
Test one 2FA backup-code
System enables 2FA

Login
Ask for login/password
Ask for 2FA
User cannot give a right code?
Ask for a backup code.

from recovery.

nickurt avatar nickurt commented on May 27, 2024

Yeah, same request here aswell, what is the best workflow/example in an application for this?

from recovery.

nickurt avatar nickurt commented on May 27, 2024

Thank you!, I understand the workflow now! 👍

from recovery.

diadal avatar diadal commented on May 27, 2024

how can I test this Test one 2FA backup-code is it auto accepted by 2fa or I need to create different method to test

from recovery.

colinwilson avatar colinwilson commented on May 27, 2024

I store them in the database, encrypted, in the users table, using a json column (backup_codes)

@antonioribeiro could you expand (code wise) on how you store them encrypted? I'm currently troubleshooting storing the generated codes encrypted in a PostgreSQL json column myself (Laravel 5.6).

from recovery.

foresighthub avatar foresighthub commented on May 27, 2024

Hi,

I know this is an old thread but I have a question.

If a user uses one of the backup codes, is it best practice to delete that code from the list of backup codes and add another unique one? Or if a backup code is used it should be marked as invalid from then on.

from recovery.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.