我正在使用omniauth-auth0 gem在我的应用程序中使用auth0 starategy。现在,我想进行自定义设置,例如(对于Twitter):
request = Rack::Request.new(env)
user = User.find_by_subdomain(request.subdomain)
env['omniauth.strategy'].options[:client_id] = user.consumer_key # if using omniauth-oauth2
env['omniauth.strategy'].options[:client_secret] = user.consumer_secret # if using omniauth-oauth2
env['omniauth.strategy'].options[:consumer_key] = user.consumer_key # if using omniauth-oauth
env['omniauth.strategy'].options[:consumer_secret] = user.consumer_secret # if using omniauth-oauth
end
use OmniAuth::Builder.new do
provider :twitter, :setup => SETUP_PROC
end
不幸的是,对于auth0来说这是行不通的。如何在oomniauth-auth0策略中做到这一点?