A very simple Ruby module for querying ANU LDAP
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.bundle
lib
pkg
.document
.gitignore
.rvmrc
Gemfile
Gemfile.lock
LICENSE
README.rdoc
Rakefile
VERSION
anu-ldap.gemspec

README.rdoc

AnuLdap

Description

AnuLdap is a Ruby module for easily querying the ANU LDAP server.

Install

$ gem install anu-ldap

Usage

require "anu-ldap"

# Find users by email address:

entries = AnuLdap.find_by_email("david.porter@anu.edu.au")
entries.each do |e|
  puts "Uni ID:     #{e[:uni_id]}"
  puts "Email:      #{e[:email]}"
  puts "Given name: #{e[:given_name]}"
  puts "Surname:    #{e[:surname]}"
end

# Authenticate a user:

if AnuLdap.authenticate("u3990518", "secret")
   puts "Successfully authenticated"
else
   puts "Authentication failure"
end