SAML Single Sign-On (SSO) into Drupal using OpenAM as IdP
Overview
The Drupal SAML integration using the miniOrange SAML SP module establishes seamless SSO between OpenAM and the Drupal site. The users will be able to log in to the Drupal site using their OpenAM credentials. This document will walk you through the steps to configure Single Sign-On - SSO between Drupal as a Service Provider (SP) and OpenAM as an Identity Provider (IdP). The module is compatible with Drupal 7, Drupal 8, Drupal 9, Drupal 10, and Drupal 11.
Installation Steps
- Using Composer
- Using Drush
- Manual Installation
Configuration Steps
Drupal SAML SP Metadata
- Go to Configuration → People → SAML Login Configuration in the Administration menu. (/admin/config/people/miniorange_saml/idp_setup)
- Navigate to the Service Provider Metadata and copy the Metadata URL. (This is required in configuring the OpenAM as a SAML IdP)
Create OpenAM as a Hosted Identity Provider:
Note: If you've already set up OpenAM-hosted IDP, move on to Configure Remote Service Provider and skip this step.
- Login into your OpenAM instance as an administrator.
- Select the realm you want to use you will be redirected to the Realm Overview page.
- Click on Create SAMLv2 Providers.
- Click on Create Hosted Identity Provider.
- Enter the Identity Provider’s Name, then select a Singing Key. Choose a Circle of Trust that already exists or start a new one by giving it a name. In the Attribute Mapping section, provide the user profile attributes to send to the Service Provider.
- In the top right corner, click on the Configure button.
- Check the configuration in OpenAM's Federation tab.
Configure Remote Service Provider:
- Login into your OpenAM instance as an administrator.
- Select the realm you want to use you will be redirected to the Realm Overview page.
- Click on Create SAMLv2 Providers.
- Click on Register Remote Service Provider.
- Enter the metadata URL of the Drupal site. Select an existing Circle of Trust or create a new one by giving it a name. Provide the user profile attributes to send to the service provider in the Attribute Mapping section.
- In the top right corner, click on the Configure button.
- Download the OpenAM metadata using the URL given below.
[OpenAM ServerURL] /saml2/jsp/exportmetadata.jsp (This will be required for further configuration of Drupal)
OR
If you have multiple realms and a hosted identity Provider configured then use the URL given below.
[OpenAM ServerURL] /saml2/jsp/exportmetadata.jsp?entityid=[IdPentityID]&realm=/realmname
Configure Drupal as SAML Service Provider:
- Navigate to the Service Provider Setup tab of the Drupal site and click on Upload IDP Metadata.
- Paste the previously copied OpenAM into the Upload Metadata URL text field. Click on the Fetch Metadata button.
Note: To update Identity Provider Name, follow these steps:
- Under Action, select the Edit.
- Enter OpenAM in the Identity Provider Name text field.
- Scroll down and click on the Save Configuration button.
- Click on the Test link to test the connection between Drupal and OpenAM.
- In the test configuration window, a success message with SAML response attributes will appear if the configurations are correct; otherwise, error messages with additional troubleshooting instructions will appear. Click on Done
Congratulations! you have successfully configure OpenAM as SAML Identity Provider (IdP) and Drupal as SAML Service Provider.
How does SAML SSO login work?
- Open a new browser/private window and navigate to the Drupal site login page.
- Click the Login using Identity Provider (OpenAM) link.
- You will be redirected to the OpenAM login page. Enter the OpenAM credentials. After successful authentication, the user will be redirected back to the Drupal site.