This tutorial will help walk you through setting up a an integration between ADFS and KnowledgeOwl using SAML 2.0.
The screenshots below may not match your version of ADFS, but the steps to complete the integration should be the same.
Step 1: Add your IdP info to KnowledgeOwl
- On your Windows server, find and open AD FS 2.0 Management (commonly found in the start menu under Administrative Tools).
- Once you have opened ADFS Management, go to Action > Edit Federation Service Properties.
- Copy the link that is displayed under Federation Service identifier.
- In KnowledgeOwl, go to Settings > SSO.
- Paste the link you copied in Step 3 into the field iDP entityID.
- For most ADFS builds, the Login URL and the Logout URL will be the base URL of the iDP entityID with "/adfs/ls/" as the endpoint instead of "/adfs/services/trust":If this is not true for your setup, you will need to locate the URL that your ADFS setup uses for authentication.
- Be sure to Save your changes in KnowledgeOwl if you're not immediately continuing to Step 2.
Step 2: Upload the IdP certificate to KnowledgeOwl
Next we will want to export our ADFS cert into a x509 DER format to upload into KnowledgeOwl. To do so:
- In AD FS 2.0, go to Service > Certificates.
- In the main pane, right-click on the certificate in the Token-signing section.
- Click View Certificate... in the right-click menu.
- Open the Details tab.
- Click on Copy to File...
- This will bring up a Certificate Export Wizard. In the wizard, choose next until you get to the format page. On the format page make sure that DER encoded binary X.509 is selected and choose next.
- Choose a filename and a location that you will remember for the cert and then finish the wizard.
- In KnowledgeOwl, upload the certificate file you created by clicking the Update link in the IdP Certificate section:
- Once you have selected the correct certificate, be sure to Save your changes.
Step 3: Enable SAML SSO
Once you have entered the 3 IdP fields and have uploaded the IdP certificate into KnowledgeOwl, make sure that the Enable SAML SSO checkbox is checked, and Save the SSO Settings page.
Step 4: Add the KnowledgeOwl SP info to your IdP
Now that KnowledgeOwl has your information, you will need to grab some data from KnowledgeOwl to add into AD FS.
- In KnowledgeOwl, click on the View KnowledgeOwl SP Metadata button underneath your IdP Certificate.
- This will open up a pop-up with KnowledgeOwl XML metadata within it.If you aren't seeing any metadata, ensure that you've checked the box to "Enable SAML SSO" and saved. The metadata is only generated after this option is saved.
- Click anywhere in the Service Provider Metadata for Knowledge Base pop-up to highlight the full XM contents and copy it.
- Open up a simple text editor of your choice (Notepad works well).
- Paste the metadata text into Notepad.
- Choose File > Save as...
- Change the Save as type: to All Files. Save the file as ko-metadata.xml (the .xml extension is required!).
- In ADFS, click on Add Relying Party Trust... which will open up the Add Relying Party Trust Wizard. Click on Start within that wizard.
- On the next screen, select Import data about the relying party from a file.
- Browse to the XML metadata that we saved in Step 7 and choose Next.
- Choose a name that makes sense, such as "KnowledgeOwl SSO", add whatever notes you would like, and click Next.
- For most setups, you can click next until you finish this wizard, which should open up the Edit Claim Rules dialog.If the Edit Claim Rules dialog does not open automatically, you can navigate to it by going to Trust Relationships > Relying Party Trusts, select the trust identifier you created in Step 11, and click on Edit Claim Rules....
- In the Edit Claim Rules dialog click on Add Rule...
- Choose the default Send LDAP Attributes as Claims and click Next.
- Here you can choose what information you want to send to KnowledgeOwl. At the very least you need to send the E-Mail Addresses.
- Click on Add Rule... again.
- This time under Claim rule template: choose Transform an Incoming Claim and click Next.
- Set the Claim rule name to KO Name ID or something similar.
- Set the Incoming claim type to E-Mail Address.
- Set the Outgoing claim type to Name ID.
- Set the Outgoing name ID format to Email.
- Be sure the option to Pass through all claim values is selected. Your configuration should look a bit like this:
- Click Finish.
Step 5: Enable debug mode
ADFS may send the attribute claims over in a way that you are not expecting.
In order to view how ADFS is sending the claims, in Knowledgeowl:
- In Settings > SSO in the SAML Settings tab, check the box next to Enable debug mode.
- In a private browser window or in an incognito tab, copy and paste the SP Login URL into the address bar. If the above steps were done correctly, you should be asked to log into your AD server where you will be redirected back to your knowledge base.
- In debug mode, you'll then see a list of the IdP attributes that ADFS is sending over.
- Keep this window open while you work on Step 6. Once you're done with Step 6, be sure to uncheck the box next to Enable debug mode and re-save the settings.
Step 6: Map SAML attributes to fields in KnowledgeOwl
With your debug window open, you can now map SAML attributes to fields in KnowledgeOwl. To do so:
- In KnowledgeOwl, go to Settings > SSO.
- Open the SAML Attribute Map tab.
- In your debug output, locate the attribute value that contains your email address, and copy the Attribute Name exactly as it appears after the colon.
- On the SAML Attribute map tab of KnowledgeOwl, paste that attribute name into the fields for SSO ID and Username / Email.
- To map additional fields, repeat this process. See Direct Reader Attribute Map for more information.
- If you cannot directly map an IdP attribute to a KnowledgeOwl reader attribute, you can use Custom Attribute Map Rules to do some mappings or logic for you. See the help page on those rules for more info.
- Once you're done mapping fields, uncheck the Enable debug mode checkbox.
- Save all your changes.
- In the tab or window that contained the debug information, click on the Re-login to see any changes link at the top to log in through ADFS again. If everything was successful, you will be logged into your knowledge base and you will now have a working SAML SSO integration with ADFS.
Step 7: Optional settings
With your ADFS SAML SSO login working, you can now review two additional options:
- To make it so that SAML SSO is the only access method for your knowledge base, check the Restrict Access to SSO box in Settings > SSO and Save. This will override the Default Access selection in Settings > Security.
- If you'd like to use the AFDS SAML SSO as your only or primary reader authentication mechanism, set the Default Login Page in Settings > Security to SAML Login URL and Save.
See SSO options for different knowledge base setups for more information.