CyberDeck / devise-fido-u2f

A devise module to authenticate additionally with a FIDO U2F hardware token, e.g. a Yubico USB security key.
MIT License
36 stars 4 forks source link

Allows to disable this gem on a User instance #7

Closed zedtux closed 6 years ago

zedtux commented 6 years ago

This is useful when using different 2fa gems and allowing the user to choose which one he'd like to use.


To give more information about this change, in my application I'm forcing the user to select a 2fa method (Google Authenticator and Fido U2F), but I want them to choose which one they'd like. The first time they connect, I want to show them page where they can choose they're preferred method.

The devise_google_authenticator gem is already managing a gauth_enabled? attribute on the User instance, so I added the same in this gem so that my workflow is the following:

  1. Request received
  2. Devise Google Authenticator gem checks gauth_enabled?
  3. Device Fido UI2f gem checks u2fauth_enabled?
  4. A No2Fa module I wrote is reached and redirects to the page to choose the authentication method

After the user selected one of the 2 methods, the same workflow is executed, but stops at the devise module which gets enabled.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.5%) to 99.519% when pulling 43534d5da223b8bc5fa4dc749ed617d6a6bee68d on Pharmony:features/allows-disabling-the-gem into b05717d71253c82dd78856d7ca683b4acdd3a7c5 on CyberDeck:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.5%) to 99.519% when pulling 43534d5da223b8bc5fa4dc749ed617d6a6bee68d on Pharmony:features/allows-disabling-the-gem into b05717d71253c82dd78856d7ca683b4acdd3a7c5 on CyberDeck:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.5%) to 99.519% when pulling 3bce37589f84965540b188af05d384c5fb094f00 on Pharmony:features/allows-disabling-the-gem into b05717d71253c82dd78856d7ca683b4acdd3a7c5 on CyberDeck:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.5%) to 99.528% when pulling ca983619df10332517cc99568adb913cac5944a2 on Pharmony:features/allows-disabling-the-gem into b05717d71253c82dd78856d7ca683b4acdd3a7c5 on CyberDeck:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.5%) to 99.528% when pulling de0775c61a5b7ba753be57ea55d6cea521e826f0 on Pharmony:features/allows-disabling-the-gem into b05717d71253c82dd78856d7ca683b4acdd3a7c5 on CyberDeck:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.5%) to 99.528% when pulling a50e0a87c1633c08c525e908955a49031c976eee on Pharmony:features/allows-disabling-the-gem into b05717d71253c82dd78856d7ca683b4acdd3a7c5 on CyberDeck:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.5%) to 99.528% when pulling a50e0a87c1633c08c525e908955a49031c976eee on Pharmony:features/allows-disabling-the-gem into b05717d71253c82dd78856d7ca683b4acdd3a7c5 on CyberDeck:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.5%) to 99.528% when pulling a50e0a87c1633c08c525e908955a49031c976eee on Pharmony:features/allows-disabling-the-gem into b05717d71253c82dd78856d7ca683b4acdd3a7c5 on CyberDeck:master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling c38ea5de83fc9284e55aee4d0d61b8ac721ecd91 on Pharmony:features/allows-disabling-the-gem into b05717d71253c82dd78856d7ca683b4acdd3a7c5 on CyberDeck:master.

CyberDeck commented 6 years ago

I really like that one. Actually, within my "toy" app, I have intregration of the Google authenticator on the TODO list. Thank you!