Skip to content
robdimarco edited this page Nov 23, 2011 · 4 revisions

omniauth_crowd integrates Atlassian Crowd with OmniAuth to allow Rack-based applications (e.g. Rails, Sinatra) to use Crowd as an authentication source. It is designed to work with OmniAuth 1.0.0.

TL;DR

In file Gemfile

gem 'omniauth_crowd', :require=>"omniauth/crowd"

In file config/initializers/omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :crowd, :crowd_server_url=>"https://YOUR_CROWD_SERVER", 
    :application_name=>"YOUR_CROWD_APPLICATION", 
    :application_password=>"YOUR_CROWD_APPLICATION_PASSWORD"
end

A Little Background

Atlassian Crowd is an identity management and Single Sign On (SSO) platform. It is used by companies to create a single source of identity management that integrates LDAP, custom logins, etc. across an enterprise. Since v2.0, Crowd supplies a REST API that allows for validation of user name, passwords, and returns profile information.

OmniAuth is a framework for Rack-based applications (like Rails and Sinatra) to authenticate the identity of users using third-party frameworks.

This gem forms the bridge between these two services to allow for Crowd to be used by Rack applications that rely on OmniAuth for authentication.

Prerequisites

Setup Identity Management

You will need to have a user with a unique identity that we are authorizing for. I recommend using Devise, it is the hotness in identity management. Other options include authlogic, restful_authentication, roll your own, etc.

Set up OmniAuth in your application

Details on setting up OmniAuth with your authentication system is out of scope here.

For our purposes, we will assume that you are using Devise for your Rack application authentication. For more details, check out the devise wiki and the Devise OmniAuth Example to see how to get Devise and OmniAuth integrated.

You need to get OmniAuth working with your identity management system first before you attempt to use Crowd (or any other third party service).

Set up Crowd

Follow the instructions in Crowd's documentation for Adding an Application. When doing this, remember the application name and password. We will need these later

Adding Crowd Configuration to a Rails 3 Application

Step One -- Add Gems to the Gemfile

In file Gemfile

gem 'omniauth_crowd', :require=>"omniauth/crowd"

This will download the Gem and require appropriately

Step Two -- Add OmniAuth Provider

In file config/initializers/omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :crowd, 
    :crowd_server_url=>"https://YOUR_CROWD_SERVER",
    :application_name=>"YOUR_CROWD_APPLICATION",
    :application_password=>"YOUR_CROWD_APPLICATION_PASSWORD"
end

Step Three

Login with Crowd!

Additional Links