This gem provides a simple authentication mechanism to validate the maintainer of a given Autonomous System in DN42
Add to your application's Gemfile:
gem 'omniauth-dn42', git: 'https://github.com/routedbits/omniauth-dn42.git'
require 'sinatra'
require 'omniauth'
class MyApplication < Sinatra::Base
use Rack::Session::Cookie
use OmniAuth::Strategies::Dn42
end
Rails.application.config.middleware.use OmniAuth::Builder do
provider :developer unless Rails.env.production?
provider :dn42
end
-
Clone the repo
-
Install the required gems
bundle install
-
Install Sinatra
gem install sinatra
-
Make changes
-
Use the example to verify
ruby examples/sinatra.rb
-
Request Phase (
request_phase
) [OmniAuth builtin]- Renders ASN Prompt
- Sets Post to
method_path
(OmniAuth posts toother_phase
method)
-
Other Phase (OmniAuth builtin)
-
Method Phase
- Receives form post from
request_phase
- Calls dn42regsrv for auth attributes of AS Maintaner object
- Renders select form
- Receives form post from
-
Challenge Phase
- Receives post from
method_phase
- Renders challenge for user to sign
- Receives post from
-
-
Callback Phase (OmniAuth builtin)
- Validates challenge from
challenge_phase
- Validates challenge from