-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make site dynamic to support SFDX scratch orgs #26
Comments
Hm, good question. I think that's something that we need to know from omniauth itself. Can you pass it a dynamic value for If it isn't supported, I guess the fallback would be an env variable as you described. |
I'm going to submit a PR to Otherwise I can submit a fallback PR here. |
So would this cause our issue when we log into our app, with Sandbox accounts for testing, we're seeing the developer account in the app instead of the test account's?
|
Perhaps my PR can help #28 ? |
@kriom thanks for contributing. Will take a look this week. |
A simple solution without using other strategies: Rails.application.config.middleware.use OmniAuth::Builder do
if ENV['SALESFORCE_SCRATCH_ORG_URL'].present?
OmniAuth::Strategies::Salesforce.default_options[:client_options][:site] = ENV['SALESFORCE_SCRATCH_ORG_URL']
end
provider :salesforce, ENV['SALESFORCE_OAUTH_KEY'], ENV['SALESFORCE_OAUTH_SECRET']
end This makes the provider still salesforce (ie |
I'm not sure what the best way to accomplish this is, but with SFDX scratch orgs the site needed for OAuth is not
login.salesforce.com
but whatever the instance URL of the scratch org is. This is causing problems for me with doing development with SFDX.One way I could solve this is by loading
client_options.site
from an environment variable if it exists and usinglogin.salesforce.com
otherwise.I'm happy to do the work needed for a PR on this one, but I'm looking for a little bit of a suggestion just to make sure it fits with the project and isn't rejected when submitted.
The text was updated successfully, but these errors were encountered: