ruby-on-rails - omnaith-auth0 gem 的自定义设置
问题描述
我正在使用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 策略中执行此操作?
解决方案
推荐阅读
- ghostscript - PostScript,用 ghostscript 看不到视觉输出
- java - 如何仅为 Http 状态码 500 配置 RetryTemplate?
- python - 无法在 pycharm for python 3.6 中安装 MySQLdb 模块
- google-apps-script - Google 电子表格在弹出窗口中显示新文件的 URL
- c - 并行内循环减慢程序
- java - java serviceability agent vs jmc vs visualvm
- xml - rabbitmq xml配置应用项目的文件夹结构
- android - OpenCV - NDK 更新后对 'cv::CascadeClassifier::detectMultiScale()' 的未定义引用
- ios - 在框架错误中包含非模块化标头
- reactjs - React.js 路由器不同的背景图片