Search Results :
×The Drupal SAML integration using the miniOrange SAML SP module establishes seamless SSO between SimpleSAMLphp and the Drupal site. The users will be able to log in to the Drupal site using their SimpleSAMLphp credentials. This document will walk you through the steps to configure Single Sign-On - SSO between Drupal as a Service Provider (SP) and SimpleSAMLphp as an Identity Provider (IdP). The module is compatible with Drupal 7, Drupal 8, Drupal 9, and Drupal 10.
Composer require 'drupal/miniorange_saml'
{BaseURL}/admin/config/people/miniorange_saml/idp_setup
drush en drupal/miniorange_saml
drush cr
{BaseURL}/admin/config/people/miniorange_saml/idp_setup
{BaseURL}/admin/config/people/miniorange_saml/idp_setup
From the SimpleSAML installation directory, open config/config.php and edit the following:
‘enable.saml20-idp’ ⇒ true
Create an authentication source in config/authsources.php. The file should contain a single entry, refer below:
<?php $metadata['__DYNAMIC:1__'] = [ /* * The hostname for this IdP. This makes it possible to run multiple * IdPs from the same configuration. '__DEFAULT__' means that this one * should be used by default. */ 'host' => '__DEFAULT__', /* * The private key and certificate to use when signing responses. * These are stored in the cert-directory. */ 'privatekey' => 'example.org.pem', 'certificate' => 'example.org.crt', /* * The authentication source which should be used to authenticate the * user. This must match one of the entries in config/authsources.php. */ 'auth' => '' Example:- 'example-userpass', // You can find this in Step Number 3 ];
This configuration creates two users - student and employee, with the passwords studentpass and employeepass. The username and password are stored in the array index (student:studentpass for the student-user). The attributes for each user are configured in the array referenced by the index. So for the student user, these are:
[ 'uid' => ['student'], 'eduPersonAffiliation' => ['member', 'student'], ],
The attributes will be returned by the IdP when the user logs on.
Using openssl command
openssl req -newkey rsa:3072 -new -x509 -days 3652 -nodes -out example.org.crt -keyout example.org.pem
Generate it by using any online tools and add them in cert directory.
The extension should be likeexample.org.crt //(Public Key)example.org.pem //(Private Key)
Note:SimpleSAMLphp will only work with RSA certificates. DSA certificates are not supported.
The SAML 2.0 IdP is configured by the metadata stored in metadata/saml20-idp-hosted.php. This is a minimal configuration:
<?php $metadata['__DYNAMIC:1__'] = [ /* * The hostname for this IdP. This makes it possible to run multiple * IdPs from the same configuration. '__DEFAULT__' means that this one * should be used by default. */ 'host' => '__DEFAULT__', /* * The private key and certificate to use when signing responses. * These are stored in the cert-directory. */ 'privatekey' => 'example.org.pem', 'certificate' => 'example.org.crt', /* * The authentication source which should be used to authenticate the * user. This must match one of the entries in config/authsources.php. */ ' auth' => '' Example:- 'example-userpass', // You can find this in Step Number 3 ];
The identity provider you are configuring needs to know about the service providers you are going to connect to it. This is configured by metadata stored in metadata/saml20-sp-remote.php. This is a minimal example of a metadata/saml20-sp-remote.php metadata file for a SimpleSAMLphp SP: (Replace example.com with your Drupal domain name.)
<?php $metadata['https://example.com/plugins/authentication/miniorangesaml/'] = [ 'AssertionConsumerService' => 'https://example.com/samlassertion', 'SingleLogoutService' => 'https://example.com/user/logout', 'NameIDFormat' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress', 'simplesaml.nameidattribute' => 'mail', 'simplesaml.attributes' => true, 'attributes' => array('mail', 'givenname', 'sn', 'memberOf'), ];
Note: That the URI in the Entity ID and the URLs to the AssertionConsumerService and Single Logout Service endpoints change between different service providers. If you have the metadata of the remote SP as an XML file, you can use the built-in XML to SimpleSAMLphp metadata converter, which by default is available as /admin/metadata-converter.php in your SimpleSAMLphp installation.
Congratulations! you have successfully configured SimpleSAML as SAML Identity Provider and Drupal as SAML Service Provider.
Explore the advanced features offered by the module with full-featured trial. You can initiate the trial request using Request 7-day trial button of the module or reach out to us at drupalsupport@xecurify.com for one-on-one assistance from Drupal expert.
Need Help? We are right here!
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
This privacy statement applies to miniorange websites describing how we handle the personal information. When you visit any website, it may store or retrieve the information on your browser, mostly in the form of the cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not directly identify you, but it can give you a more personalized web experience. Click on the category headings to check how we handle the cookies. For the privacy statement of our solutions you can refer to the privacy policy.
Necessary cookies help make a website fully usable by enabling the basic functions like site navigation, logging in, filling forms, etc. The cookies used for the functionality do not store any personal identifiable information. However, some parts of the website will not work properly without the cookies.
These cookies only collect aggregated information about the traffic of the website including - visitors, sources, page clicks and views, etc. This allows us to know more about our most and least popular pages along with users' interaction on the actionable elements and hence letting us improve the performance of our website as well as our services.