Problem

We are looking for a REST API endpoint to import the SAML config json file in to our Atlassian SSO.

Solution

This article refers to our plugin version SAML Single Sign On 4.x. If you are using an older version, you need to disable the plugin and enable it again, after deleting a configuration via API (see below).

You can use the REST API of the SAML SSO app which allows you to download and upload the SAML Single Sign-On configuration.
Please note that this is our private API, there might be breaking changes in upcoming versions. Please contact our support, if something does not work as expected anymore.

GET

Use the following example to download the configuration.

curl -u username:password -X GET https://base-url/rest/samlsso-admin/1.0/config --output saml.json
CODE

Open the saml.json file and verify that the file contains data.

DELETE

You could also delete existing configurations with the call below, i.e. for a simple test of importing a configuration again.
The SAML SSO configuration menu should then not show any identity provider config anymore. 

curl -u username:password -X DELETE https://base-url/rest/samlsso-admin/1.0/config
CODE

Please open Jira Administration > Manage apps > SAML Single Sign-On > Configure and you should see the welcome wizard screen which you can close.

In the app configuration, you will also see the info that no IdP is configured.

PUT

Now it is time to put the configuration back to the system.

curl -u username:password -X PUT https://base-url/rest/samlsso-admin/1.0/config -d @saml.json --header "Content-Type: application/json"
CODE

Verify, that the correct configuration has been imported correctly