1
0
Fork 0
mirror of https://github.com/omniauth/omniauth.git synced 2022-11-09 12:31:49 -05:00
OmniAuth is a flexible authentication system utilizing Rack middleware.
Find a file
Erik Michaels-Ober f6f7d5ef42 Merge pull request #378 from thickpaddy/master
Fixed - Invalid response when linked in user has no public profile url
2011-07-10 09:59:44 -07:00
lib Bump version to 0.3.0.rc1 2011-06-27 13:29:56 -07:00
oa-basic Allow bundling of unreleased versions of sub-gems 2011-06-28 19:17:40 -07:00
oa-core Bump version to 0.3.0.rc1 2011-06-27 13:29:56 -07:00
oa-enterprise Replace tabs with spaces 2011-06-29 14:58:59 -07:00
oa-more Allow bundling of unreleased versions of sub-gems 2011-06-28 19:17:40 -07:00
oa-oauth Merge pull request #378 from thickpaddy/master 2011-07-10 09:59:44 -07:00
oa-openid Allow bundling of unreleased versions of sub-gems 2011-06-28 19:17:40 -07:00
tasks Fix bug in versioning task to allow pre-release gems 2011-06-27 13:07:37 -07:00
.autotest Replace watchr with autotest 2011-04-22 13:13:24 -05:00
.document Initial commit to rack-oauthable. 2010-03-25 19:37:03 -04: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 Test against Rubinius 2.0 2011-06-08 12:28:56 -04: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
omniauth.gemspec Update gemspec 2011-05-12 18:40:28 -07:00
Rakefile Rakefiles are executables 2011-05-14 10:11:04 -07:00
README.md Adding Yahoo to README 2011-07-03 18:51:23 -07:00

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:

Compatibility

OmniAuth is tested against the following Ruby versions:

  • 1.8.7
  • 1.9.1
  • 1.9.2
  • JRuby (note, the Evernote strategy is not available for JRuby)
  • Rubinius
  • REE

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 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:

OmniAuth Core

License

OmniAuth is licensed under the MIT License.