OmniAuth is a flexible authentication system utilizing Rack middleware.
Go to file
Erik Michaels-Ober b2626350cb Merge pull request #646 from thoughtless/better-xmlcanonicalizer
switch to xmlcanonicalizer to keep global namespace cleaner
2012-10-13 07:49:19 -07:00
lib Bump version to 0.3.2 2011-10-20 16:15:58 -07:00
oa-basic Bump version to 0.3.2 2011-10-20 16:15:58 -07:00
oa-core Merge pull request #475 from pivotaldinamundo/0-3-stable 2011-11-02 06:52:27 -07:00
oa-enterprise switch to xmlcanonicalizer to keep global namespace cleaner 2012-10-11 13:34:50 -07:00
oa-more Bump version to 0.3.2 2011-10-20 16:15:58 -07:00
oa-oauth Dropbox requires use of api version 1 2011-11-17 14:00:07 -08:00
oa-openid Bump version to 0.3.2 2011-10-20 16:15:58 -07:00
tasks Make release script compatible with Ruby 1.8 2011-10-20 16:20:31 -07:00
.gemtest Gem dependency refactor 2011-04-22 02:52:52 -05:00
.gitignore Ignore lots of stuff that should be ignored 2011-05-09 21:33:18 -07:00
.rspec Switch to progress format to make Travis builds easier to read etc. 2011-04-25 10:22:29 -05:00
.travis.yml Revert "Remove JRuby support" 2011-08-08 13:45:50 -07:00
.yardopts Gem dependency refactor 2011-04-22 02:52:52 -05:00
Gemfile Update yard dependency to version 0.7 2011-05-18 08:46:04 -04:00
LICENSE.md Convert license to Markdown 2011-05-07 11:55:39 -07:00
README.md Update CI image URL [ci skip] 2011-08-31 22:14:09 -07:00
Rakefile Make Rakefile executable 2011-08-27 11:02:05 -07:00
omniauth.gemspec Removed repetition of word 'that' from description 2011-08-24 07:48:06 +05:30

README.md

OmniAuth: Standardized Multi-Provider Authentication

OmniAuth is a new Rack-based authentication system for multi-provider external authentcation. OmniAuth is built from the ground up on the philosophy that authentication is not the same as identity, and is based on two observations:

  1. The traditional 'sign up using a login and password' model is becoming the exception, not the rule. Modern web applications offer external authentication via OpenID, Facebook, and/or OAuth.
  2. The interconnectable web is no longer a dream, it is a necessity. It is not unreasonable to expect that one application may need to be able to connect to one, three, or twelve other services. Modern authentication systems should allow a user's identity to be associated with many authentications.

Installation

To install OmniAuth, simply install the gem:

gem install omniauth

Continuous Integration

Build Status

Providers

OmniAuth currently supports the following external providers:

Usage

OmniAuth is a collection of Rack middleware. To use a single strategy, you simply need to add the middleware:

require 'oa-oauth'
use OmniAuth::Strategies::Twitter, 'CONSUMER_KEY', 'CONSUMER_SECRET'

Now to initiate authentication you merely need to redirect the user to /auth/twitter via a link or other means. Once the user has authenticated to Twitter, they will be redirected to /auth/twitter/callback. You should build an endpoint that handles this URL, at which point you will have access to the authentication information through the omniauth.auth parameter of the Rack environment. For example, in Sinatra you would do something like this:

get '/auth/twitter/callback' do
  auth_hash = request.env['omniauth.auth']
end

The hash in question will look something like this:

{
  'uid' => '12356',
  'provider' => 'twitter',
  'user_info' => {
    'name' => 'User Name',
    'nickname' => 'username',
    # ...
  }
}

The user_info hash will automatically be populated with as much information about the user as OmniAuth was able to pull from the given API or authentication provider.

Resources

The best place to find more information is the OmniAuth Wiki. Some specific information you might be interested in:

Core Team

Supported Rubies

This library aims to support and is tested against the following Ruby implementations:

If something doesn't work on one of these interpreters, it should be considered a bug.

This library may inadvertently work (or seem to work) on other Ruby implementations, however support will only be provided for the versions listed above.

If you would like this library to support another Ruby version, you may volunteer to be a maintainer. Being a maintainer entails making sure all tests run and pass on that implementation. When something breaks on your implementation, you will be personally responsible for providing patches in a timely fashion. If critical issues for a particular implementation exist at the time of a major release, support for that Ruby version may be dropped.

License

OmniAuth is released under the MIT License.