Giter Club home page Giter Club logo

omniauth's Introduction

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.

omniauth's People

Contributors

achiurizo avatar aduffeck avatar brianthecoder avatar caged avatar chouti avatar coderoshi avatar he9qi avatar heydiplo avatar holman avatar jamesarosen avatar jamiew avatar keeguon avatar kepi avatar kltcalamay avatar kvnsmth avatar leemartin avatar leshill avatar lexer avatar majormajors avatar msch avatar needto avatar pchilton avatar philnash avatar pupeno avatar quake avatar rainux avatar sferik avatar softprops avatar vinibaggio avatar wesgibbs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.