Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby
branch: master

This branch is 1 commit behind barnabyalter:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
Gemfile
MIT-LICENSE
README.rdoc
Rakefile
authpds-nyu.gemspec

README.rdoc

Build Status Dependency
Status Coverage Status

AuthpdsNyu

Libraries for user authentication and authorization via NYU Libraries PDS system. It extends Authpds and provides NYU Libraries' specific configuration.

Basics

Generate User-like model

$ rails generate model User username:string email:string firstname:string \
  lastname:string mobile_phone:string crypted_password:string password_salt:string \
  session_id:string persistence_token:string login_count:integer last_request_at:string \
  current_login_at:string last_login_at:string last_login_ip:string current_login_ip:string \
  user_attributes:text refreshed_at:datetime

Configure User-like model

class User < ActiveRecord::Base
  serialize :user_attributes

  acts_as_authentic do |c|
    c.validations_scope = :username
    c.validate_password_field = false
    c.require_password_confirmation = false
    c.disable_perishable_token_maintenance = true
  end
end

Generate UserSession model

$ rails generate authlogic:session UserSession

Configure UserSession with Authpds options

class UserSession < Authlogic::Session::Base
  pds_url "https://login.library.nyu.edu"
  redirect_logout_url "http://bobcat.library.nyu.edu"
  calling_system "nyu_system"
  anonymous true
end

Create UserSessions controller

$ rails generate controller UserSessions --no-assets --no-helper

Mixin authpds methods into UserSessionsController

class UserSessionsController < ApplicationController
  require 'authpds'
  include Authpds::Controllers::AuthpdsSessionsController
end

Mixin authpds methods into ApplicationController

class ApplicationController < ActionController::Base
  protect_from_forgery
  require 'authpds'
  include Authpds::Controllers::AuthpdsController
end

Overview

The module extends Authpds and should be compatible with Authpds configuation. It also provides hooks for custom functionality. The documentation below describes NYU specific config methods available.

Config Options Available

:opensso_url

Base OpenSSO url (login.nyu.edu:443/sso)

:aleph_url

Aleph url (aleph.library.nyu.edu)

:aleph_default_adm

Aleph default ADM (NYU50)

:aleph_default_sublibrary

Aleph default sublibrary (BOBST)

Something went wrong with that request. Please try again.