This guide provides step by step instructions to configure and test Workspace ONE as a trusted federation identity provider with OpenAM.
Prerequisites.
- Test Instance of ForgeRock OpenAM v 5.5 (or higher) installed and configured.
- Workspace ONE tenant
- Configured Service Providers (ie. Salesforce, O365 etc..)
- This solution will only work if you have architected OpenAM to leverage an IDP Proxy as below:
Note: I've been told by ForgeRock that this will also work using their Identity Gateway however I've not personally tested this.
Download Workspace ONE IDP Metadata
- Log into Workspace ONE Administration console and go to:
- Catalog -> Settings -> SAML Metadata -> Identity Provider (IDP) metadata
- Download and Save the file.
- Log into the OpenAM Console
- Click on the Realm where you want to configure Workspace ONE. This doc will assume you are configuring the Top Level Realm (/).
- Click Configure SAMLv2 Provider from the Dashboard
Create Workspace ONE as an Identity Provider in OpenAM
- Log into the OpenAM Console
- Click on the Realm where you want to configure Workspace ONE. This doc will assume you are configuring the Top Level Realm (/).
- Click Configure SAMLv2 Provider from the Dashboard
- Click “Configure Remote Identity Provider”
- Select “File” and Upload the Workspace ONE metadata:
- Select an existing Circle of Trust. Note: WorkspaceONE needs to be in the same COT as other SP’s and IDP’s that will be used in this environment.
- Select OK
- Click Save
- Click Create Authentication Scheme and Module
Configure IDP Proxy
- From the left menu, click on Applications -> SAML
- Ensure your IDP Proxy is listed and is of type “SP;IDP”
- Click on your IDP Proxy from the Entity Providers List
- Click on the IDP Tab
- Click on Advanced
- Scroll down to “IDP Finder Implementation”
- Add the following if not there:
- IDP Finder Implementation Class: com.sun.identity.saml2.plugins.SAML2IDPProxyFRImpl
- IdP Finder JSP: proxyidpfinder.jsp
- Enable the Proxy IDP Finder for all SP’s.
- Click Save and then it the back button.
Configure Service Providers
- In the Federation Tab, copy the Entity ID for Workspace ONE and the Entity ID for the OpenAM IDP instance that will handle authentications that are not sent to Workspace ONE
- Click on the entity id for your service provider
- Click on the Advanced Tab
- Scroll down to IDP Proxy and Enable the Proxy
- Check “Proxy all Requests”
- Check “Use IDP Finder”
- Set the proxy count to something greater than 2.
- In the Proxy List, paste the Entity ID’s of all your IDP servers
- Click Save and Back.
Export IDP Proxy Metadata
- In your browser, go to: http://[openAM-Host]:8080/openam/saml2/jsp/exportmetadata.jsp??entityid=[EntityOfIDPProxy]
Configure OpenAM as a SP in Workspace ONE
- Log into Workspace ONE Administration -> Catalog
- Click on Add Application -> Create a new one
- Provide a name ie. OpenAM
- Leave SAML 2.0 Post as the profile and Click Next
- Under Configuration, paste the SAML Metadata and Click Save
- Select Sign Assertion
- Select the correct NameID value to match the value that OpenAM is expecting.
- Click on Entitlements and add the necessary entitlements.
- Click Save
Update Workspace ONE Policies (optional)
- Log into the Workspace ONE Administration -> Identity and Access Management
- Configure the appropriate authentication policies as per your requirements Refer to VMware Documentation on how to configure policies.
Test the Configuration
We should test our configuration out first to ensure everything is working before we modify the JSP to automate the IDP selection.
- Log into your SP and you should be redirected to your IDP Finder on the IDP Proxy:
- Test out all you configured IDP’s to ensure that Federation is working all the way through.
Update ProxyIDPFinder.JSP to Automate the Selection.
- You will need to SSH into your IDP Proxy Host and modify the proxyidpfinder.jsp file which is located in $TOMCAT_HOME/webapps/openam
- Open up the file in your file editor and search for the following block of code:
- Comment out the first line
- You will then need to prepare your code to select the user agent.
- Using a Base64 Encoding tool such as https://www.freeformatter.com/base64-encoder.html you will need to encode each of your IDP Entity ID’s.
- Once you have each of your encoded IDP’s, you can create something similar to below:
String userAgent = request.getHeader("User-Agent");
if(userAgent != null && userAgent.indexOf("Android") != -1){
samlIdP="aHR0cHM6Ly9kc2FzLnZtd2FyZWlkZW50aXR5LmNvbS9TQUFTL0FQSS8xLjAvR0VUL21ldGFkYXRhL2lkcC54bWw=";
}else if (userAgent != null && userAgent.indexOf("iPhone") != -1){
samlIdP="aHR0cHM6Ly9kc2FzLnZtd2FyZWlkZW50aXR5LmNvbS9TQUFTL0FQSS8xLjAvR0VUL21ldGFkYXRhL2lkcC54bWw=";
}else{
samlIdP="aHR0cDovL29wZW5hbS5vbmUtaWRlbnRpdHkuY2E6ODA4MC9vcGVuYW0=";
}