A devise extension for Duo Security’s 2FA tool.
<img src=“https://travis-ci.org/uid0/duo-devise.svg?branch=master” alt=“Build Status” />
-
A Duo Security Account duosecurity.com
First, create an initializer in config/initalizer/duosecurity.rb
Duo.integration_key = "DIPZTGZ5VREUTUD2IYIH" Duo.secret_key = ENV['DUO_SECRET_KEY'] || "CE1iQU9DEJTu5zdvc7FtDpHxLO9lAz8JHbwioWRm" Duo.api_hostname = "api-6dc644da.duosecurity.com"
Next, add the gem to your Gemfile:
gem 'devise' gem 'duo-devise'
And then run bundle install
From there, let’s add duo-devise to your rails app:
rails g duo_devise:install --haml: generate the views in HAML (not my strongest language, YMMV) --sass: generate the stylesheets in SASS
Finally, configure your Devise User Model:
rails g duo_devise [MODEL_NAME]
Alternatively, you can add the following lines to your User
model:
devise :duo_authenticatable, :database_authenticatable
Finally, run the migrations:
rake db:migrate
There will (hopefully) be more to this, including Custom Views and workflows, but, I really have no clue on what/if/how this will actually work today. Only time will tell.
-
Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.
-
Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.
-
Fork the project.
-
Start a feature/bugfix branch.
-
Commit and push until you are happy with your contribution.
-
Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright © 2014 Ian Wilson. See LICENSE.txt for further details.