Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails OmniAuth.config.full\u主机的多个值_Ruby On Rails_Devise_Omniauth_Stripe Payments - Fatal编程技术网

Ruby on rails OmniAuth.config.full\u主机的多个值

Ruby on rails OmniAuth.config.full\u主机的多个值,ruby-on-rails,devise,omniauth,stripe-payments,Ruby On Rails,Devise,Omniauth,Stripe Payments,我正在尝试在我的SaaS平台上配置Omniauth并设计使用Stripe和LinkedIn策略 作为平台的一部分,每个客户端都可以拥有自己独特的域 我可以让LinkedIn在我的客户端网站上工作,但是Stripe要求你在他们的管理界面中列出所有可能的回调URL。为了解决这个问题,我通过OmniAuth.config.full\u host将www.myapp.com设置为回调url,但这意味着我有一个静态回调url,然后通过状态参数传递客户端ID 这对Stripe有效,但是LinkedIn开始失

我正在尝试在我的SaaS平台上配置Omniauth并设计使用Stripe和LinkedIn策略

作为平台的一部分,每个客户端都可以拥有自己独特的域

我可以让LinkedIn在我的客户端网站上工作,但是Stripe要求你在他们的管理界面中列出所有可能的回调URL。为了解决这个问题,我通过
OmniAuth.config.full\u host
将www.myapp.com设置为回调url,但这意味着我有一个静态回调url,然后通过
状态
参数传递客户端ID

这对Stripe有效,但是LinkedIn开始失败,因为回调域不再匹配原始请求


是否有办法仅为某些策略(即仅条带)设置
OmniAuth.config.full_host

config/initializers/OmniAuth.rb

OmniAuth.config.full_host = lambda do |env|
  if env['omniauth.strategy'].is_a?(OmniAuth::Strategies::Stripe)
    #return url for stripe
  else
    #return url for others
  end
end

另一个选项可能是覆盖
OmniAuth::Stragies::Stripe#callback_url

#config/initializers/stripe.rb
module OmniAuth
  module Strategies
    class Stripe
      def full_host
        #return url for stripe
      end
    end
  end
end
原始的
OmniAuth::Strategy#full_host
方法将用于其他策略