Skip to content
Duo two-factor authentication for Ruby web applications
JavaScript Ruby CSS
Branch: master
Clone or download
Latest commit 62d3a0f Jun 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
css created demo to test websdk changes against Aug 8, 2016
js Update Duo Web SDK to versions 2.8 May 24, 2019
lib Added Ruby Gem and Bundler support Jun 9, 2016
test Added Ruby Gem and Bundler support Jun 9, 2016
.travis.yml Added TravisCI testing configuration file Jun 7, 2017
Gemfile Added Ruby Gem and Bundler support Jun 9, 2016
LICENSE
README.md Added TravisCI badge Jun 16, 2017
Rakefile Added Ruby Gem and Bundler support Jun 9, 2016
duo_web.gemspec
server.rb created demo to test websdk changes against Aug 8, 2016

README.md

Overview

Build Status

duo_ruby - Duo two-factor authentication for Ruby web applications: https://duo.com/docs/duoweb

This package allows a web developer to quickly add Duo's interactive, self-service, two-factor authentication to any web login form - without setting up secondary user accounts, directory synchronization, servers, or hardware.

What's here:

  • js - Duo Javascript library, to be hosted by your webserver.
  • lib/duo_web.rb - Duo Ruby SDK to be integrated with your web application
  • test/test_duo_web.rb - Unit tests for our SDK

Installing

Development:

$ git clone https://github.com/duosecurity/duo_ruby.git
$ cd duo_ruby

System:

$ gem install duo_web

Or add the following to your project:

gem 'duo_web', '~> 1.0'

Using

$ irb -r ./lib/duo_web.rb
irb(main):001:0> Duo.sign_request(ikey, skey, akey, username)
=> "TX|...TX_SIGNATURE...==|...TX_HASH...:APP|...APP_SIGNATURE...==|...APP_HASH..."

Demo

$ gem install thin
  • Configure server.rb with host, ikey, skey, akey, and username from your WebSDK integration
class DuoLoginAdapter
  def initialize
    @host = 'yournamehere.duosecurity.com'
    @ikey = 'aaaaaaaaaaaaaaaaaaaa'
    @skey = 'vDMdvfJAo6Mhb4ZEuQzNXRe2MvrzXD9qYnpbhOZK'
    @akey = 'vDMdtfQUo6Mhb4JEuQzNXRe0MvszXD9qYnpbh1PZ'
    @username = 'your_duo_username'
    ...
  • Start the demo
$ ruby server.rb

Testing

$ rake
Loaded suite /usr/lib/ruby/vendor_ruby/rake/rake_test_loader
Started
..

Finished in 0.001006152 seconds.
---------------------------------------------------------------------------------------
2 tests, 13 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
---------------------------------------------------------------------------------------
1987.77 tests/s, 12920.51 assertions/s

Linting

$ rubocop

Support

Report any bugs, feature requests, etc. to us directly: support@duosecurity.com

You can’t perform that action at this time.