<p>OmniAuth is a new Rack-based authentication system for multi-provider external authentcation. OmniAuth is built from the ground up on the philosophy that <strong>authentication is not the same as identity</strong>, and is based on two observations:</p>
<ol>
<li>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.</li>
<li>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.</li>
</ol>
<h2id='installation'>Installation</h2>
<p>To install OmniAuth, simply install the gem:</p>
<p>Now to initiate authentication you merely need to redirect the user to <code>/auth/twitter</code> via a link or other means. Once the user has authenticated to Twitter, they will be redirected to <code>/auth/twitter/callback</code>. You should build an endpoint that handles this URL, at which point you will will have access to the authentication information through the <code>omniauth.auth</code> parameter of the Rack environment. For example, in Sinatra you would do something like this:</p>
<preclass="code"><spanclass='get identifier id'>get</span><spanclass='string val'>'/auth/twitter/callback'</span><spanclass='do do kw'>do</span>
<p>The <code>user_info</code> 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.</p>
<h2id='resources'>Resources</h2>
<p>The best place to find more information is the <ahref='http://github.com/intridea/omniauth/wiki'>OmniAuth Wiki</a>. Some specific information you might be interested in:</p>