0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
omniauth strategy for authenticating against AlephX Service
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

= 1.3.2
= 1.1.5
 Project Readme

#OmniAuth Alephx Strategy

Installation

Add this line to your application's Gemfile:

gem 'omniauth-alephx'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omniauth-alephx

Usage

Use like any other OmniAuth strategy:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :alephx, url: 'http://aleph.server.be/X', library: 'usm50'
end

Or like in Rails:

config.omniauth :alephx,{
  :url => "http://aleph.server.be/X",
  :library => "usm50"
}

Configuration Options

Required

OmniAuth CAS requires at least one of the following two configuration options:

  • url - Defines the URL of your AlephX server (e.g. http://example.org:8080/X)
  • library - Defines the name of your aleph user database (e.g. usm50)

Optional

Other configuration options:

  • form - proc or lambda that returns a rails response object.
config.omniauth :alephx,{
  :url => "http://aleph.server.be/X",
  :library => "usm50",
  :form => lambda { |env|
    AlephxSessionController.action(:new).call(env)
  }
}

When form is not set, options below will be used.

  • title_form
  • label_username
  • label_password
  • label_submit

Class methods

  • add_filter(&block)

    change input parameters

OmniAuth::Strategies::Alephx.add_filter do |params|

  unless params['username'].nil?

    #if the 'username' looks like a EAN-13, then strip off the last check digit
    params['username'].strip!
    if params['username'] =~ /^\d{13,}$/
      params['username'] = params['username'][0..-2]
    end

  end
  
end

##Author

Nicolas Franck