
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
devise_google_authenticator
Advanced tools
= Devise Google Authenticator
This is a devise[https://github.com/plataformatec/devise] extension to allow your app to utilise Google Authenticator[http://code.google.com/p/google-authenticator/] for Time-based One Time Passwords (TOTP).
== Installation
Add the gem to your Gemfile (don't forget devise too):
Don't forget to "bundle install"
=== Devise Installation (In case you haven't done it)
Before you can setup Devise Google Authenticator you need to setup Devise first, you need to do the following (but refer to https://github.com/plataformatec/devise for more information)
Install Devise:
Setup the User or Admin model
Configure your app for authorisation, edit your Controller and add this before_filter:
Make sure your "root" route is configured in config/routes.rb
=== Automatic Installation (Lets assume this is a bare bones app)
Run the following generator to add the necessary configuration options to Devise's config file:
After you've created your Devise user models (which is usually done with a "rails g devise MODEL"), set up your Google Authenticator additions:
Don't forget to migrate if you're NOT using Mongoid as your database ORM, Mongoid installations will have appropriate fields added to the model after the command above:
=== Installation With Existing Users
After the above steps have been performed, you'll need to generate secrets for each user: User.where(:gauth_secret => nil).each do |user| user.send(:assign_auth_secret) user.save end By default, users won't need to perform two-factor authentication (gauth_enabled='f'). By visiting /MODEL/displayqr (eg: /users/displayqr) and submitting the form, two-factor authentication will then be turned on (gauth_enabled=1) and required for subsequent logins.
== Configuration Options
The install generator adds some options to the end of your Devise config file (config/initializers/devise.rb)
== Custom Views
If you want to customise your views (which you likely will want to, as they're pretty ugly right now), you can use the generator:
== Usage
With this extension enabled, the following is expected behaviour:
== I18n
The install generator also installs an english copy of a Devise Google Authenticator i18n file. This can be modified (or used to create other language versions) and is located at: config/locales/devise.google_authenticator.en.yml
== Changes
== Thanks (and unknown contributors)
This extension would not exist without the following other projects and associated authors (Whom I have turned to for inspiration and definitely have helped contributing by providing awesome Devise extensions. A lot of this code has been refactored from various sources, in particular these - in particular Sergio and Devise_invitable for his excellent unit test code):
== Contributing to devise_google_authenticator
== Copyright
Copyright (c) 2014 Christian Frichot. See LICENSE.txt for further details.
FAQs
Unknown package
We found that devise_google_authenticator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.