// Module included in the following assemblies:
// Upstream:
// tutorials/topics/as_t2sf-intro.adoc
// tutorials/topics/as_sf2db-intro.adoc
// connecting/topics/as_connecting-to-sf.adoc
// Downstream:
// connecting-fuse-online-to-applications-and-services/upstream/as_connecting-to-sf.adoc
// fuse-online-sample-integration-tutorials/upstream/as_t2sf-intro.adoc
// fuse-online-sample-integration-tutorials/upstream/as_sf2db-intro.adoc


[id='create-salesforce-connection_{context}']
= Creating a Salesforce connection

To create an integration that accesses data in Salesforce, you 
must first create a Salesforce connection.  
After you create a Salesforce connection, you can use it in multiple 
integrations.

.Prerequisites
* You are logged in to {prodname}. 
* {prodname} is open in a web browser. 
* You must have already registered your {prodname} environment as an
application that can access Salesforce. 
* You added the Salesforce client ID and client secret that you received
after registration to the {prodname} *Settings* page. 
+
ifeval::["{context}" == "t2sf"]
If you did not already register {prodname}, see 
link:{LinkSyndesisTutorials}#register-with-salesforce_t2sf[Registering {prodname} as a Salesforce client application].
endif::[]
ifeval::["{context}" == "sf2db"]
If you did not already register {prodname}, see 
link:{LinkSyndesisTutorials}#register-with-salesforce_sf2db[Registering {prodname} as a Salesforce client application].
endif::[]

+
Be sure to wait 2 - 10 minutes after registering your {prodname}
installation as a Salesforce client before you try to create a
Salesforce connection. 

.Procedure

. In {prodname}, in the left panel, click *Connections* to display available connections.
. Click *Create Connection* to display
the available connectors. A connector is a template for creating one
or more connections.
. Click the *Salesforce* connector.
. Click *Connect Salesforce* to display a Salesforce authorization page.
You might need to log in to Salesforce before you see the authorization page.
+
If *Connect Salesforce* does not appear, then your {prodname} environment
is not registered as a Salesforce client application. See
link:{LinkSyndesisConnectorGuide}#register-with-sf_salesforce[Registering {prodname} as a Salesforce client application].
When you try to create a Salesforce connection and your {prodname} environment 
is not registered as a Salesforce client application, then {prodname} displays
multiple fields that prompt for authorization information. While you can
create a Salesforce connection by entering values in these fields, 
it is not recommended. 
+
[NOTE]
====
The following error indicates that Salesforce does not have the
correct {prodname} callback URL:

`error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration`

If you get this error message, then in Salesforce, ensure that the {prodname}
callback URL is specified according to the instructions in
link:{LinkSyndesisConnectorGuide}#register-with-salesforce_salesforce[Registering {prodname} as a Salesforce client application].
====
. Click *Allow* to return to {prodname}.
. In the *Name* field, enter your choice of a name that
helps you distinguish this connection from any other connections.
For example, enter `*SF Connect 1*`.
. In the *Description* field, optionally enter any information that
is helpful to know about this connection. For example,
enter `*Sample Salesforce connection
that uses my Salesforce login credentials.*`
. Click *Save* to see that the connection you
created is now available. If you entered the example name, you would
see that *SF Connect 1* appears as a connection that you can 
choose to add to an integration.
