简体   繁体   English

Salesforce Sandbox Omniauth for Rails应用程序

[英]Salesforce Sandbox Omniauth for Rails app

i'm trying to enable login by salesforce accounts through omniauth-salesforce Gem for a sandbox accounts, but it always redirect to login.salesforce.com and i want to redirect to test.salesforce.com 我正在尝试通过omn​​iauth-salesforce Gem为沙盒帐户启用Salesforce帐户登录,但是它始终重定向到login.salesforce.com,我想重定向到test.salesforce.com

in device.rb file i have 在device.rb文件中

config.omniauth :salesforce, configatron.salesforce.app_id, configatron.salesforce.app_secret

so i tried to replace this line with 所以我试图用

config.omniauth :salesforce_sandbox, configatron.salesforce.app_id, configatron.salesforce.app_secret  

or 要么

config.omniauth OmniAuth::Strategies::SalesforceSandbox, configatron.salesforce.app_id, configatron.salesforce.app_secret  

but both failed the first failed with error 但都失败了,第一个失败并出现错误

Not found. Authentication passthru.

and the second failed with error 第二个失败,并显示错误

undefined method `to_sym' for OmniAuth::Strategies::SalesforceSandbox:Class

The problem was with the Class name SalesforceSandbox so when using salesforce_sandbox for 问题出在类名称SalesforceSandbox上,因此在将salesforce_sandbox用于

require "omniauth-salesforce"
config.omniauth :salesforce, configatron.salesforce.app_id, configatron.salesforce.app_secret
config.omniauth :salesforce_sandbox, configatron.salesforce_sandbox.app_id, configatron.salesforce_sandbox.app_secret

this one didn't work so i forked the gem and by changing the name to Salesforcesandbox so it now works this way: 这个没有用,所以我分叉了宝石,并通过将名称更改为Salesforcesandbox,现在它以这种方式工作:

require "omniauth-salesforce"
config.omniauth :salesforce, configatron.salesforce.app_id, configatron.salesforce.app_secret
config.omniauth :salesforcesandbox, configatron.salesforce_sandbox.app_id, configatron.salesforce_sandbox.app_secret

i forked it here: 我在这里分叉:

gem "omniauth-salesforce", ">=1.0.3", :git => 'git://github.com/mohamed-mahmoud/omniauth-salesforce.git'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM