Setting up MIRACL Trust SSO as an Identity Provider within Salesforce
These instructions are up-to-date at the time of writing, but you should refer back to the Salesforce documentation on SAML settings for SSO to check for any changes. We cannot guarantee the accuracy of our SP-specific guidance.
1. Create Self-Signed Certificate:
- In the Administer panel under ‘Security Controls’ click on Certificate and Key Management, then click on Create Self-Signed Certificate:
- Enter a Label and Unique Name and select a key size of 4096:
- Now click on ‘Download Certificate’ and you will have it ready to be deployed when you create your SSO service.
2. Create SSO settings
- Under ‘Administer’ click on Single Sign-On Settings under ‘Security Controls’:
- Click on ‘New from Metadata File’:
- Browse to pick up the metadata file which you previously downloaded from MIRACL Trust SSO:
- Click ‘Create’:
- Enter the details for your SSO setup:
- The Issuer URL is the path to your IdP metadata file (
- Set SAML Identity Type to ‘Assertion contains the Federation ID from the User object’
- Set SAML Identity Location to ‘Identity is in an Attribute element’ (urn:oid automatically set?)
- Identity Provider Login URL should match that as provided in your SSO dashboard
- Click ‘Browse’ to pick up the Identity Provider Certificate, which is found in the ___ section of your SSO dashboard
- Upload the downloaded self-signed certificate to Assertion Decryption Certificate (this is the certificate which you downloaded in Step 1 of this guide)
- Save and close.
3. Set up your domain
- In the Administer panel, click on Domain Management > My Domain:
- You will be shown what your allocated domain name is. Click login to test it, followed by Deploy to Users:
- You will then be presented with a confirmation message. Click ‘OK’ to deploy.
4. Enable SSO
- Return to Single Sign-On Settings and click edit:
- Tick SAML Enabled and save:
- Return to Domain Management > My Domain and click Edit in the Authentication Configuration section:
- In the config screen tick your SAML service and save:
5. Access SSO url
- You should now be able to visit the url for your configured SSO domain:
- Clicking on Login with a Different Username should then give the option to login with your newly-configured service:
6. Add Federation ID to associated user from your directory
- In Administer go to Manage Users > Users and click to edit the user associated with SSO:
- Scroll down to the Single Sign-On Information and add the email address from your user directory which is passed to Salesforce:
7. Download the Salesforce metadata file
- Return to Security Controls > Single Sign-On Settings and click on the name of your service:
- Click to download the Salesforce SSO metadata:
- Save the file as metadata.xml.
Configuring Salesforce as a Service Provider profile in MIRACL Trust SSO
sp: salesforce: description: Salesforce Customer Relationship Management (CRM) relay_state: / login_url: https://example.my.salesforce.com logout_url: https://example.lightning.force.com/secur/logout.jsp metadata: >- <!-- insert downloaded SP metadata here --> sign_response: true sign_assertion: true encrypt_assertion: true authorize: - - email: ^[^@]+@example.com
Note that sp name is used to create your IdP-initiated login url, i.e.
Note that login_url and logout_url should be edited as per the url you are issued by the Salesforce admin console.
In the metadata field you need to enter the downloaded metadata, as per the final step in the previous section.
The downloaded metadata file must be converted to a single line with a command such as:
echo -e "\n"$(cat metadata.xml | tr -d '\n')"\n"
The contents will then be output in the terminal in a format that can be pasted into the metadata field.
If using JSON format, the downloaded metadata file must be converted to a single line and the " characters need to be escaped with \ to meet the json structure requirements. This can be achieved by running the following command on the downloaded metadata.xml file:
echo -e "\n"$(cat metadata.xml | tr -d '\n' | sed -E 's/"/\\"/g')"\n"
The contents will then be output in the terminal in a format that can be pasted into the metadata field of a JSON file.
- In the authorize subsection, you can control what users are allowed to attempt login by following one or both of the below steps:
- Call up an LDAP setup from an
ldap.yamlfile stored in
- Configure a regex list of email addresses/domains. The above config shows an example of how you would use
email: ^[^@]+@example.com$to only allow users from a certain email domain to login.
Note that if this is not set correctly, you will receive ‘unauthorized user’ messages.
For more detailed info on using LDAP and regex to control authorized users, please see the LDAP and authorization menu section
Save and close the file.
In your /etc/miracl-sso/config.yaml file make sure you add
salesforce.yamlto the list of ‘includes’:
includes: - core.yaml # service providers - service_providers/salesforce.yaml
As always after config changes, restart the server with
sudo service miracl-sso restart
Now your service is configured, you can visit
https://<yourssoip>/servicesto login to the service using IdP-initiated login, or visit the Salesforce login page and SP-initiated login will be triggered automatically.
You will be able to login using the in-browser PIN pad or with the MIRACL Trust app. When logging in to your SSO service for the first time you will be asked to register an email address so as to confirm your identity and register you as a user.