Skip to content
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

Source Salesforce: Support oauth'ing into sandbox environment #7722

Closed
sherifnada opened this issue Nov 8, 2021 · 2 comments · Fixed by #8797
Closed

Source Salesforce: Support oauth'ing into sandbox environment #7722

sherifnada opened this issue Nov 8, 2021 · 2 comments · Fixed by #8797

Comments

@sherifnada
Copy link
Contributor

sherifnada commented Nov 8, 2021

Tell us about the problem you're trying to solve

When oauth'ing a salesforce user into a sandbox environment, we need to send them to test.salesforce.com rather than login.salesforce.com. Our current server implementation of salesforce oauth always assumes they are not trying to use a sandbox environment and redirects them to login.salesforce.com.

Unfortunately, many enterprise users are not allowed to use production environments for testing new tools. Therefore, they would not be able to adopt Airbyte Cloud without being able to access the sandbox environment.

Ideally, we would wait for #6971 to be implemented and use the functionality offered there to implement this flow. However, since that could take some time, we need to come up with a way to allow new Airbyte Cloud customers to start
Once #6971 is implemented, we need to look at the user's input config and determine which oauth configuration to use.

Describe the solution you’d like

This fix has the following components:

  1. Disable the sandbox option of the Salesforce connector and always assume we are using the production environment (remove it from the spec but not from the code, and allow additional properties = true. if the undocumented option is passed then the connector should use sandbox)
  2. Create a fork of the salesforce connector, source-salesforce-sandbox (similar to the source-file-secure fork of the source-file connector) which always assumes we are using the salesforce sandbox environment. By the end we should have two salesforce connectors, source-salesforce which always assumes NOT sandbox, and source-salesforce-sandbox which always assumes sandbox environment. Publish both connectors normally like we do with any connector.
  3. Create a new oauth flow in the server which can log the user in for the sandbox environment. For testing this flow, use the Salesforce (Sandbox) Lastpass credentials. The only difference between this flow and the current salesforce flow is that the current salesforce flow uses the login.salesforce.com endpoint whereas the new flow should use test.salesforce.com. That's it. Otherwise, it can use the same credentials.
  4. Once you've tested the flow, create a PR and merge as normal on salesforce.
  5. Create a ticket to revert 1 & 2 once OAuth Flow: new authSpecifications supporting field references from connector config as dependency #6971 is implemented. That is, once that ticket is implemented, we should go back to having a single salesforce connector with a sandbox toggle whose oauth flow is controlled based on the toggle.
@VasylLazebnyk
Copy link

blocked by #7915

@sherifnada
Copy link
Contributor Author

@vitaliizazmic the UI logic has been merged, this issue should no longer be blocked

vitaliizazmic added a commit that referenced this issue Jan 11, 2022
vitaliizazmic added a commit that referenced this issue Jan 11, 2022
…ching to advanced_auth (#8797)

* Source Salesforce #7722 - change spec to use advanced_auth

* Source Salesforce #7722 - update oauth flow

* Source Salesforce #7722 - reformat

* Source Salesforce #7722 - fixing get environment in oauth flow

* Source Salesforce #7722 - improve spec

* Source Salesforce #7722 - reformat

* Source Salesforce #7722 - bump version and update docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment