Import, Export and Modify a User Sync Configuration
This tutorial explains how to download (export) an existing User Sync connector configuration, how to upload (import) it back again, and how to modify (if needed) it and upload it back again.
That way you could re-use parts of existing configurations, i.e. on a staging server, without creating everything again by hand.
Normally this only makes sense, if you've added a lot of transformation rules across the config.
In our tutorial, we will show you two solutions. You can use REST API or a cheat code to get access to the JSON configuration file directly.
The steps below are intended for users who are familiar with REST and JSON, please contact our support, if you have any doubts.
Changing a configuration that way should be done with good care.
REST API
Export Configuration - REST
Find the User Sync connector ID by clicking on the edit button first, go to Connector Id and Directory, and copy the Connector ID.
cURL
GET the connector configuration. The URL to retrieve the config looks like this, with the connector ID at the end:
- curl -u user:password -X GET https://<baseurl>/rest/samlsso-admin/1.0/usersync/connector/<connector-ID>
You could also directly create a JSON file with the content of the connector configuration. In our example, we will create a JSON file called 'usersync_export.json' in the directory '~/Downloads/'
- curl -u user:password -X GET https://<baseurl>/rest/samlsso-admin/1.0/usersync/connector/<connector-ID> --output ~/Downloads/usersync_export.json
Postman
GET the connector configuration. The URL to retrieve the config looks like this, with the connector ID at the end:
- https://<basurl>/rest/samlsso-admin/1.0/usersync/connector/68e7f826-af8d-43f3-b303-4d3a28e83993
Use a local user and password (or API Token) with admin permissions for the Basic Auth. REST doesn't work with SAML.
Modify Configuration - REST
Extract the configuration from the response
not everything in the response from the call above is the configuration, you only need to preserve the configuration node of the JSON response
We recommend pasting the response to a config.json file and opening it in a text editor like Notepad++ or any other editor that highlights opening and closing brackets
the below example shows the part that requires to be extracted, the value of the configuration field, including the curly brackets
some child nodes have been collapsed for better readability
Copy that part, paste it to a new file, and edit it as required
in the sample below, I've changed the connector name and added a transformation
Import Configuration - REST
cURL
PUT (import) the edited configuration back to your instance. If you import a modified configuration it is important that your JSON file only contains the configuration node of the connector.
- curl -u user:password -X PUT https://<baseurl>/rest/samlsso-admin/1.0/usersync/connector/<connector-id> -d @usersync_import.json --header "Content-Type: application/json"
Postman
Copy the edited configuration and paste it back to Postman...
... into the Body tab with the radio button at "raw" and As JSON
change the request method to PUT and press send
you should get a 200 OK Result and see the complete response again
checking the User Sync connector via the UI after refreshing the page should reflect the changes
JSON
Export Configuration - JSON
Open the User Sync connector, you want to export, by clicking on the edit button first.

Just type the cheat code 'godmode' to open a new dialog with the JSON-data.

Extract the configuration from the response
We recommend pasting the response to an us-export.json file and opening it in a text editor like Notepad++ or any other editor that highlights opening and closing brackets

Modify Configuration - JSON
Open the us-export.json file in a text editor like Notepad++ or any other editor that highlights opening and closing brackets.
Not everything in the file is the configuration, you only need to preserve the configuration node of the JSON response
Edit the file as required
in the sample below, I've changed the connector name and added a transformation

Import Configuration - JSON
Create a new connector.

You don't need to start any configuration. Only type the cheat code 'godmode' again.

Delete the current configuration, which you see in the current connector configuration dialog.
Copy & Paste your saved (or modified) configuration into the dialog.
Apply the dialog (just press Close)
Save and Return the User Sync Connector configuration.
Checking the User Sync connector via the UI after refreshing the page should reflect the changes
Patch a connector configuration
It's possible to update specific parts of the configuration using HTTP PATCH. This can be done either using JSON Merge Patch (RFC 7686) or JSON Patch (RFC 6902).
JSON Patch
To update specific values, send a JSON patch (see https://jsonpatch.com/) as HTTP Patch with content-type application/json-patch+json
- [{
- "op": "replace",
- "path": "/redirectToSso",
- "value": true
- }]
- curl -u username:password -X PATCH https://base-url/rest/samlsso-admin/1.0/config -d @patched_json.json --header "Content-Type: application/json-patch+json"
JSON Merge Patch
JSON Merge patch allows to just specify the JSON-fragment that should be changed (see https://datatracker.ietf.org/doc/html/rfc7386). To use this syntax, send the JSON as HTTP Patch with content-type application/merge-patch+json.
- {
- "redirectToSso" : true
- }
- curl -u username:password -X PATCH https://base-url/rest/samlsso-admin/1.0/config -d @patched_json.json --header "Content-Type: application/merge-patch+json"