forked from discourse/discourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathomniauth.rb
More file actions
48 lines (39 loc) · 1.69 KB
/
Copy pathomniauth.rb
File metadata and controls
48 lines (39 loc) · 1.69 KB
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
require 'openssl'
require 'openid_redis_store'
# if you need to test this and are having ssl issues see:
# http://stackoverflow.com/questions/6756460/openssl-error-using-omniauth-specified-ssl-path-but-didnt-work
Rails.application.config.middleware.use OmniAuth::Builder do
provider :open_id,
:store => OpenID::Store::Redis.new($redis),
:name => 'google',
:identifier => 'https://www.google.com/accounts/o8/id',
:require => 'omniauth-openid'
provider :open_id,
:store => OpenID::Store::Redis.new($redis),
:name => 'yahoo',
:identifier => 'https://me.yahoo.com',
:require => 'omniauth-openid'
# lambda is required for proper multisite support,
# without it subdomains will not function correctly
provider :facebook,
:setup => lambda { |env|
strategy = env['omniauth.strategy']
strategy.options[:client_id] = SiteSetting.facebook_app_id
strategy.options[:client_secret] = SiteSetting.facebook_app_secret
},
:scope => "email"
provider :twitter,
:setup => lambda { |env|
strategy = env['omniauth.strategy']
strategy.options[:consumer_key] = SiteSetting.twitter_consumer_key
strategy.options[:consumer_secret] = SiteSetting.twitter_consumer_secret
}
provider :github,
:setup => lambda { |env|
strategy = env['omniauth.strategy']
strategy.options[:client_id] = SiteSetting.github_client_id
strategy.options[:client_secret] = SiteSetting.github_client_secret
}
provider :browser_id,
:name => 'persona'
end