/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2014 ForgeRock AS. All rights reserved.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
Protocol://hostname:portNumber/admin/oauth.html
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
https://localhost:8443/admin
3) You should now see the Salesforce connector icon with the connector disabled at this point. Use the
Consumer Key and Consumer Secret that was retrieved in the section above to complete the OAuth 2.0 flow
-For this sample there are two mappings one from Salesforce Users to Managed Users and going back from
6) Click on the Reconcile Now button to perform the recon. If you click on the arrow on the left hand side by the
7) To take a close look at the users that you brought in from Salesforce click on the User view button in the
Now that we are confident that we pulled in the users from Salesforce we want to test the mapping we created
from Managed User to Salesforce User. We can do this by updating one of the users by selecting them while we
10) For this sample we will just modify a first name of the entry we are looking at and click update.
If you go back to your user view inside of Salesforce you will see that user now reflects the change you
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
3) At this point, you will be redirected to Salesforce to start the OAuth flow. You will be prompted
-d "grant_type=authorization_code"
-d "client_id=39pHRjzMVGOBdkd_TtUemBIrEgUEApjm26LlptbMwzqFHO2z5Urhxkz82JIeIfw1_LWdPMmv9mgK7iQMFhb7F"
-d "client_secret=4205519783546230274" -d "redirect_uri=https://localhost:8443/admin/oauth.html"
-d "code=aivXI2CLPrTMEmYhL5xJ8ib2Prx4OPchx_j4KaUZqKLk3AV064UQZByb4wB.xZviGxw6Pp5Et1%3D%3D
Response:
{
"issued_at":"1416247254725",
"scope":"id api refresh_token",
"token_type":"Bearer",
"refresh_token":"5ASqK1VUUxep8tr93PeH6_gFfgjlM3QIo.dPFmaDYG43GrVTizDDQZKbxnJt2kvljmd5_Abjgq_ahOuJ9_jEWnaQ",
"signature":"GENERATED_SIGNATURE",
"access_token":"YOUR_ACCESS_TOKEN"
}
Now you have everything you need to edit the samples/salesforce/conf/provisioner.salesforce-salesforce.json
"configurationProperties" : {
"connectTimeout" : 120000,
"loginUrl" : YOUR_LOGIN_URL,
"idleCheckInterval" : 10000,
"refreshToken" : "5ASqK1VUUxep8tr93PeH6_gFfgjlM3QIo.dPFmaDYG43GrVTizDDQZKbxnJt2kvljmd5_Abjgq_ahOuJ9_jEWnaQ",
"clientSecret" : "4205519783546230274",
"clientId" : "39pHRjzMVGOBdkd_TtUemBIrEgUEApjm26LlptbMwzqFHO2z5Urhxkz82JIeIfw1_LWdPMmv9mgK7iQMFhb7F",
"instanceUrl" : "https://test.salesforce.com",
"version" : 29
}
"enabled" : true
--header "X-OpenIDM-Password: openidm-admin"
--header "Content-Type: application/json"
{
"name": "salesforce",
"enabled": true,
"config": "config/provisioner.salesforce/salesforce",
"objectTypes": [
"User",
"PermissionSet",
"PermissionSetAssignment",
"Profile",
"PermissionSetLicenseAssign",
"Organization",
"PermissionSetLicense",
"Group",
"GroupMember"
],
"connectorRef": {
"connectorName": "org.forgerock.openidm.salesforce.Salesforce",
"bundleName": "org.forgerock.openidm.salesforce",
"displayName": "Salesforce Connector",
"systemType": "provisioner.salesforce",
"bundleVersion": "2.0.29.1-RC3-SNAPSHOT"
},
"ok": true
}
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
A sync.json is included with this sample which maps some user attributes from Salesforce to Managed User
Request :
--header "X-OpenIDM-Password: openidm-admin"
--header "Content-Type: application/json"
--request POST "https://localhost:8443/openidm/recon?_action=recon&mapping=sourceSalesforceUser_managedUser"
Response :
{"_id":"3d83b958-dfec-4675-8c49-68c568d0980b","state":"ACTIVE"}
A quick look at the reconciliation entry will tell us what happened during the reconciliation process :
Request :
--header "X-OpenIDM-Password: openidm-admin"
--header "Content-Type: application/json"
{
"_id":"3d83b958-dfec-4675-8c49-68c568d0980b",
"mapping":"sourceSalesforceUser_managedUser",
"state":"SUCCESS",
"stage":"COMPLETED_SUCCESS",
"stageDescription":"reconciliation completed.",
"progress":{
"source":{
"existing":{
"processed":5,
"total":"5"
}
},
"target":{
"existing":{
"processed":0,
"total":"0"
},
"created":5
},
"links":{
"existing":{
"processed":0,
"total":"0"
},
"created":5
}
},
"situationSummary":{
"SOURCE_IGNORED":0,
"MISSING":0,
"FOUND":0,
"AMBIGUOUS":0,
"UNQUALIFIED":0,
"CONFIRMED":0,
"SOURCE_MISSING":0,
"ABSENT":5,
"TARGET_IGNORED":0,
"UNASSIGNED":0,
"FOUND_ALREADY_LINKED":0
},
"statusSummary":{
"FAILURE":0,
"SUCCESS":5
},
"parameters":{
"object":{
"sourceQuery":{
"resourceName":"system/salesforce/User",
"_queryId":"query-all-ids"
},
"targetQuery":{
"_queryId":"query-all-ids"
}
},
"pointer":{
"empty":true
},
"transformers":[
],
"set":false,
"map":true,
"string":false,
"wrappedObject":{
"targetQuery":{
"_queryId":"query-all-ids",
},
"sourceQuery":{
"_queryId":"query-all-ids",
"resourceName":"system/salesforce/User"
}
},
"list":false,
"number":false,
"boolean":false,
"null":false,
"collection":false
},
"started":"2014-11-17T20:19:07.201Z",
"ended":"2014-11-17T20:19:08.676Z",
"duration":1475
}