Search Results :

×

SSO Intregation between two Drupal sites using OAuth / OpenID Connect protocol

SSO Intregation between two Drupal sites using OAuth / OpenID Connect protocol


The Drupal OAuth/OIDC Server module enables Single Sign-On i.e. SSO between the Drupal site and any Client application that supports the OAuth or OpenID Connect protocol. Here, we go through the steps to configure the module. In this Integration one Drupal site acts as an Identity Provider and another will act as the client site i.e. users will be logging into the client site using their server site credentials.

Installation Steps:


  • Download the module:
    composer require 'drupal/oauth_server_sso'
  • Go to Extend menu on your Drupal admin console and enable the module by enabling the checkbox and click on Install button.
  • Configure the module at:
    {BaseURL}/admin/config/people/oauth_server_sso/config_client
  • Install the module:
    drush en oauth_server_sso
  • Clear the cache:
     drush cr
  • Configure the module at:
    {BaseURL}/admin/config/people/oauth_server_sso/config_client
  • Navigate to Extend menu on your Drupal admin console and click on Install new module.
  • Install the Drupal OAuth / OIDC Provider - Single Sign On (SSO) module either by downloading the zip or from the URL of the package (tar/zip).
  • Click on Enable newly added modules.
  • Enable this module by checking the checkbox and click on Install button.
  • Configure the module at
    {BaseURL}/admin/config/people/oauth_server_sso/config_client

Configure Application in Drupal Client site:

  • The miniOrange OAuth Client module will be required on the Client Drupal Site. You can follow the steps mentioned in this setup guide.
  • Once you have installed the miniOrange OAuth client module on the Client site, navigate to the Configuration tab and click on the miniOrange OAuth Client Configuration.
  •  Drupal as OAuth Client Login - Under Configuration, select miniOrange OAuth Client Configuration
  • From the Select Application dropdown select Custom OAuth 2.0 Provider.
  •  Drupal as OAuth Client Login - Select Custom OAuth 2.0 Provider from Select Application
  • Enter the application name under the Display Name text field and the name you want to display on the login page link under the Login link on the login page text field.
  •  Drupal as OAuth Client Login - Enter Display Name
  • Copy the Callback/Redirect URL.

Configure Drupal as an OAuth Server:

  • Navigate to the Drupal site and go to the Configuration -> miniOrange OAuth server configuration -> OAuth Client tab.
  • Click on the Add Client button to add a new application.
  • Drupal as OAuth/OIDC Provider - Click on Add Client
  • Enter the name of your application under the Application Name text field.
  • Paste the copied Callback/Redirect URL from the Drupal site under the Callback/Redirect URL text field.
  • You can add multiple Callback URLs by clicking on the Add More button next to the Callback/Redirect URL text field.
  • Drupal as OAuth/OIDC Provider - Click on Add More to next the Callback URL field
  • Click on the Save button.
  • Copy the generated Client ID and Client secret.
  •  Drupal as OAuth/OIDC Provider - Copy the Client ID and Client Secret

Configure Drupal as OAuth Client:

  • Navigate to the Client site and paste the copied Client ID and Client Secret into the respective fields.
  •  Drupal as OAuth/OpenID Connect Login - Provide the Client ID and Client Secret
  • Add the Endpoints as specified in the table below (You can also get the same from the Scope & Endpoints section of the Drupal site -> Configuration -> miniOrange OAuth server configuration -> OAuth Client):-

    Scope profile email openid
    Authorize Endpoint {base_url_of_the_drupal_site}/mo/oauth2/authorize
    Access Token Endpoint {base_url_of_the_drupal_site}/mo/oauth2/token
    Get User Info Endpoint {base_url_of_the_drupal_site}/mo/oauth2/userinfo
  •  Drupal as OAuth/OpenID Connect Login - Provide Scope and Endpoints in ralevant field
  • You can choose where to send the Client ID and Secret from the Header and Body of the request.
  • Make sure the Enable Login with OAuth checkbox is checked and click on the Save Configuration button.
  •  Drupal as OAuth/OpenID Connect Login - Enabling the checkbox Enable Login with OAuth
  • Click on the Perform Test Configuration button to test the connection.
  •  Drupal as OAuth/OpenID Connect Login - Click on Perform Test Configuration
  • Once the Test is successful you will be navigated to the Attribute Mapping section.
  • From the Email Attribute dropdown select the attribute in which you have received the user’s email. Similarly for Username Attribute.
  • Once done with the Attribute Mapping, click on the Save Configuration button.
  • Drupal as OAuth/OpenID Connect Login - Select Email Attribute, click on Save Configuration button

You have successfully configured the SSO integration.

Let’s see how it works:

  • Open a new window/private browser and navigate to the login page of the Client Site.
  • Click on the Login with Drupal button.
  • Test SSO Connection between the Drupal sites - Click on Login with Drupal
  • Enter the Server site credentials and click on the Log in button.
  • Enter the Drupal OAuth Client credentials

You have successfully performed the SSO between 2 Drupal sites!

Need Assistance?

If you face any issues during the configuration or if you want some additional features, please contact us at drupalsupport@xecurify.com.

Additional Features:

 Case Studies
miniOrange has successfully catered to the use cases of 400+ trusted customers with its highly flexible/customizable Drupal solutions. Feel free to check out some of our unique case studies using this link.
 Other Solutions
Feel free to explore other Drupal solutions that we offer here. The popular solutions used by our trusted customers include Two Factor Authentication - 2FA, Website Security, REST & JSON API Authentication, User Provisioning and Sync. 
  24*7 Active Support
The Drupal developers at miniOrange offer quick and active support for your queries. We can assist you from choosing the best solution for your use case to deploying and maintaining the solution.
Hello there!

Need Help? We are right here!

support
Contact miniOrange Support
success

Thanks for your inquiry.

If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com