forked from kyledrake/omniauth.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.erb
63 lines (50 loc) · 2.3 KB
/
home.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<p class='big'>OmniAuth is a Ruby authentication framework that provides a
standardized interface to many different authentication providers such as
Facebook, OpenID, and even traditional username and password.</p>
<section>
<h2>Quick Links</h1>
<ul class='links'>
<li><a href='https://github.com/intridea/omniauth'>GitHub Home</a></li>
<li><a href='https://github.com/intridea/omniauth/wiki'>Full Documentation</a></li>
<li><a href='https://github.com/intridea/omniauth/issues'>Report a Problem</a></li>
</ul>
</section>
<section>
<h2>Getting Started</h2>
<p>To use OmniAuth in a project with a Gemfile, just add each of the strategies
you want to use individually:</p>
<pre><code class='ruby'>gem 'omniauth-github'
gem 'omniauth-openid'</code></pre>
<p>Now you can use the <code>OmniAuth::Builder</code> Rack middleware to build
up your list of OmniAuth strategies for use in your application:</p>
<pre><code class='ruby'>use OmniAuth::Builder do
provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET']
provider :openid, :store => OpenID::Store::Filesystem.new('/tmp')
end</pre></code>
</section>
<p>By default, OmniAuth will return auth information to the path
<code>/auth/:provider/callback</code> inside the Rack environment. In Sinatra,
for example, a callback might look something like this:</p>
<pre><code class='ruby'># Support both GET and POST for callbacks
%w(get post).each do |method|
send(method, "/auth/:provider/callback") do
env['omniauth.auth'] # => OmniAuth::AuthHash
end
end</code></pre>
<p>For additional documentation, you should see the
<a href='https://github.com/intridea/omniauth/wiki'>OmniAuth wiki</a>.</p>
<section>
<h2>Try OmniAuth!</h2>
<p>Want an idea of the different providers OmniAuth gives you the
ability to authenticate through? Try out any of the providers in the list below,
each one is a live example of authenticating with OmniAuth!</p>
<% OMNIAUTH_STRATEGIES.each do |provider| %>
<article class='provider <%= provider.slug %>'>
<h1><%= provider.name %> <small>by <a href="https://github.com/<%= provider.author %>"><%= provider.author %></a></h1>
<nav>
<a class='button' href='<%= provider.url %>'>Usage</a>
<a class='button' href='/auth/<%= provider.slug %>'>Try Me!</a>
</nav>
</article>
<% end %>
</section>