Update SAML metadata of an authentication method with curl
This article shows how to update SAML metadata from an XML file by using SSO Management API. This can be useful for example if an external IdP regularly updates its metadata and you want to automatically import it to SSO configuration.
Please refer to the API description in the documentation available at SSO Management API.
Step-by-step guide
- Refer to article Use the Ubisecure SSO Management API with curl to start using the Management API. Here it is assumed that you have a valid access token in environment variable BEARER as shown in the article.
- Download the IdP metadata and save it to file new-metadata.xml.
Update the metadata in SSO configuration. Use the name of your authentication method instead of saml.test.1 used in the example.
curl -X PUT -d @new-metadata.xml -H "Content-Type: application/xml" -H "Authorization: Bearer %BEARER%" https://sso.example.com/sso-api/method/saml.test.1/$attribute/metadata
This page is an illustrative example only - typically these calls would be made by other scripting languages or orchestration techniques.
Related articles