<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rajeshwari R Variar on Medium]]></title>
        <description><![CDATA[Stories by Rajeshwari R Variar on Medium]]></description>
        <link>https://medium.com/@rajeshwari_64648?source=rss-13eb9a036356------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vL0D-zzwfLomqvLRQwhUZw.jpeg</url>
            <title>Stories by Rajeshwari R Variar on Medium</title>
            <link>https://medium.com/@rajeshwari_64648?source=rss-13eb9a036356------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 00:44:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajeshwari_64648/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Configure Single Sign On across Multiple Drupal 8 Platforms or Websites ?]]></title>
            <link>https://medium.com/valuebound/how-to-configure-single-sign-on-across-multiple-drupal-8-platforms-or-websites-1ab9a337120b?source=rss-13eb9a036356------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ab9a337120b</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[drupal-8]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Rajeshwari R Variar]]></dc:creator>
            <pubDate>Thu, 02 Mar 2017 14:42:17 GMT</pubDate>
            <atom:updated>2017-04-07T12:58:27.115Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CHYZcahxeo90siiHvFxXBw.png" /></figure><p>What do you mean by Single Sign On? Why do we use it? When do we use it?</p><p><strong>Single Sign On</strong> is an authentication service that allows users to use one set of credentials i.e(username and password) to login to multiple sites. For example you are creating a main website for an university and there are ’n’ number of websites for ’n’ number of departments in the same university. You can login to main website, that will allow you to login to the respective department sites as well.</p><p>For SSO, there are two main parts namely, IDP (Identity Provider) and SP (Service Provider).</p><p>Configuration of SimpleSAMLphp on Drupal 8 may vary according to IDP such as Shibboleth 1.3, A-Select, CAS, OpenID, WS-Federation or OAuth.</p><p><em>Here we going to see how to setup SSO using SimpleSAMLphp using Shibboleth in Drupal 8.</em></p><p><strong>Requirements:</strong></p><ol><li>SimpleSAMLphp library (Latest Version is recommended. My version in simplesamlphp-1.14.8).</li><li>Drupal 8 (Latest Version).</li><li>SimpleSAMLPhp_auth module (<a href="https://www.drupal.org/project/simplesamlphp_auth">https://www.drupal.org/project/simplesamlphp_auth</a>).</li></ol><p><strong>SimpleSAMLphp configurations:</strong></p><p>For the site which is acting as the Service Provider, following are the configurations that need to be done.</p><ol><li>Download the SimpleSAMLphp library from (<a href="https://simplesamlphp.org/download">https://simplesamlphp.org/download</a>).</li><li>Put the folder in the level of your docroot.</li><li>In docroot directory, create a symbolic link (named simplesaml) that points to simplesamlphp-1.14.8/www directory in the DRUPAL_ROOT directory.</li><li>Command to create symbolic link is :</li></ol><p>— ln -s simplesamlphp-1.14.8/www ./simplesaml (here my version is simplesamlphp-1.14.8)</p><p>To generate certificates, create cert folder inside the simplesamlphp-1.14.8 folder as (DRUPAL_ROOT/simplesamlphp-1.14.8/cert)</p><p>5. Run the following command inside the cert folder from terminal:</p><ul><li>openssl req -new -x509 -days 3652 -nodes -out saml.crt -keyout saml.pem</li></ul><p>It will create two files <strong>saml.crt</strong> and <strong>saml.pem.</strong></p><p>6. Configure config.php which will be inside <strong>DRUPAL_ROOT/simplesamlphp-1.14.8/config/config.php</strong></p><ul><li>Change the <strong>‘store.type’</strong> as <strong>‘sql’</strong></li><li><strong>‘store.sql.dsn’</strong> as <strong>‘mysql:host=localhost;dbname=db_name’</strong> here the host will differ according to your server and dbname will be the your database name.</li><li><strong>‘Store.sql.username’</strong> <strong>as</strong> <strong>‘server database user_name’</strong></li><li><strong>‘Store.sql.password’ as ‘server database password’</strong></li><li>Enable this functionality <strong>‘enable.saml20-idp’ =&gt; true,</strong> this setting is to receive the IDP request.</li><li>Change the <strong>‘auth.adminpassword’, ‘technicalcontact_name’, ‘technicalcontact_email’</strong> as per your requirement.</li><li>Add this snippet after config = array(); (i.e) at the last line. <br> <strong>$config[‘baseurlpath’] = ‘http://&#39;. $_SERVER[‘HTTP_HOST’] .’/simplesaml/’; (its mandatory).</strong></li><li>After this step you can hit the above url.e.g:(<a href="http://example.com/simplesaml">http://example.com/simplesaml</a>)</li><li>Login as admin and type the password which you have assigned to ‘auth.adminpassword’ and the screen will look like the image below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/0*KCKq4zmiD3cxYXwJ.png" /></figure><ul><li>Goto Federation Tab and copy the <strong>SAML 2.0 SP Metadata</strong> and send it to the Identity Provider site administrator. SAML 2.0 SP Metadata will look like:</li></ul><pre>$metadata[‘http://example.com&#39;] = array (</pre><pre>‘SingleLogoutService’ =&gt; array (</pre><pre>0 =&gt; array (</pre><pre>‘Binding’ =&gt; ‘urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect’, ‘Location’ =&gt; ‘http://example.com/simplesaml/module.php/saml/sp/saml2-logout.php/default-sp&#39;,<br> ),</pre><pre>1 =&gt; array (</pre><pre>‘Binding’ =&gt; ‘urn:oasis:names:tc:SAML:2.0:bindings:SOAP’,</pre><pre>‘Location’ =&gt; ‘http://example.com/simplesaml/module.php/saml/sp/saml2-logout.php/default-sp&#39;, ), ),</pre><pre>‘AssertionConsumerService’ =&gt; array (</pre><pre>0 =&gt; array (</pre><pre>‘index’ =&gt; 0,</pre><pre>‘Binding’ =&gt; ‘urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST’,</pre><pre>‘Location’ =&gt; ‘http://example.com/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp&#39;,<br> ),</pre><pre>1 =&gt; array (<br> ‘index’ =&gt; 1,<br> ‘Binding’ =&gt; ‘urn:oasis:names:tc:SAML:1.0:profiles:browser-post’,</pre><pre>‘Location’ =&gt; ‘http://example.com/simplesaml/module.php/saml/sp/saml1-acs.php/default-sp&#39;,<br> ),</pre><pre>2 =&gt; array (</pre><pre>‘index’ =&gt; 2,</pre><pre>‘Binding’ =&gt; ‘urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact’, ‘Location’ =&gt; ‘http://example.com/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp&#39;, ),</pre><pre>3 =&gt; array (</pre><pre>‘index’ =&gt; 3,</pre><pre>‘Binding’ =&gt; ‘urn:oasis:names:tc:SAML:1.0:profiles:artifact-01’,</pre><pre>‘Location’ =&gt; ‘http://example.com/simplesaml/module.php/saml/sp/saml1-acs.php/default-sp/artifact&#39;, <br>  ),<br>),</pre><pre>‘contacts’ =&gt; array (</pre><pre>0 =&gt; array (</pre><pre>‘emailAddress’ =&gt; ‘abc@example.com’,</pre><pre>‘contactType’ =&gt; ‘technical’,</pre><pre>‘givenName’ =&gt; Example,</pre><pre>‘surName’ =&gt; Example,<br> ),<br>),</pre><pre>‘certData’ =&gt; ‘…certificate string…’<br>‘redirect.validate’ =&gt; true,<br>);</pre><pre>Paste the IDP metadata which you will receive from your IDP Provider inside <strong>/simplesamlphp/metadata/saml20-idp-remote.php.</strong> SAML 2.0 IDP metadata will look like:</pre><pre>$metadata[‘http://your-idp-domain/simplesaml/saml2/idp/metadata.php&#39;] = array(</pre><pre>‘entityid’ =&gt; ‘http://your-idp-domain/simplesaml/saml2/idp/metadata.php&#39;, ‘contacts’ =&gt; array(</pre><pre>0 =&gt; array(</pre><pre>‘contactType’ =&gt; ‘technical’,</pre><pre>‘givenName’ =&gt; ‘XYZ’,</pre><pre>‘surName’ =&gt; ‘XYZ’,</pre><pre>‘emailAddress’ =&gt; array(</pre><pre>0 =&gt; ‘abc@gmail.com’, <br>  ),<br> ),<br>),</pre><pre>‘metadata-set’ =&gt; ‘saml20-idp-remote’,</pre><pre>‘SingleSignOnService’ =&gt; array(</pre><pre>0 =&gt; array(</pre><pre>‘Binding’ =&gt; ‘urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect’, ‘Location’ =&gt; ‘http://your-idp-domain/simplesaml/saml2/idp/SSOService.php&#39;,<br> ),<br>),</pre><pre>‘SingleLogoutService’ =&gt; array(</pre><pre>0 =&gt; array(</pre><pre>‘Binding’ =&gt; ‘urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect’, ‘Location’ =&gt; ‘http://your-idp-domain/simplesaml/saml2/idp/SingleLogoutService.php&#39;,<br> ),<br> ),</pre><pre>‘ArtifactResolutionService’ =&gt; array(),</pre><pre>‘NameIDFormats’ =&gt; array(</pre><pre>0 =&gt; ‘urn:oasis:names:tc:SAML:2.0:nameid-format:transient’,</pre><pre> ),</pre><pre>‘keys’ =&gt; array(</pre><pre>0 =&gt; array(</pre><pre>‘encryption’ =&gt; FALSE,</pre><pre>‘signing’ =&gt; TRUE,</pre><pre>‘type’ =&gt; ‘X509Certificate’,</pre><pre>‘X509Certificate’ =&gt; ‘…certificate string…’,</pre><pre> ),</pre><pre>1 =&gt; array(</pre><pre>‘encryption’ =&gt; TRUE,</pre><pre>‘signing’ =&gt; FALSE,</pre><pre>‘type’ =&gt; ‘X509Certificate’,</pre><pre>‘X509Certificate’ =&gt; ‘…certificate string…’, ),<br> ),<br>);</pre><p>Now configure the <strong>authsource.php</strong> inside config folder as shown, inside <strong>default-sp array</strong> you need to write the following code:</p><pre>‘default-sp’ =&gt; array(</pre><pre>‘saml:SP’, // The entity ID of this SP. // Can be NULL/unset, in which case an entity ID is generated based on the metadata URL.</pre><pre>‘entityID’ =&gt; ‘http://yoursitedomain.com’, // The entity ID of the IdP this should SP should contact. // Can be NULL/unset, in which case the user will be shown a list of available IdPs.</pre><pre>‘idp’ =&gt; ‘http://idpsitedomain/simplesaml/saml2/idp/metadata.php&#39;,</pre><pre>// certificate file name that you have inside your cert folder.</pre><pre>‘privatekey’ =&gt; ‘saml.pem’,</pre><pre>‘certificate’ =&gt; ‘saml.crt’,</pre><pre>‘NameIDPolicy’ =&gt; null,</pre><pre>‘redirect.sign’ =&gt; true,</pre><pre>‘assertion.encryption’ =&gt; false,</pre><pre>‘sign.logout’ =&gt; true, // The URL to the discovery service. // Can be NULL/unset, in which case a builtin discovery service will be used. ‘discoURL’ =&gt; null,</pre><pre>/* * WARNING: SHA-1 is disallowed starting January the 1st, 2014. * * Uncomment the following option to start using SHA-256 for your signatures. * Currently, SimpleSAMLphp defaults to SHA-1, which has been deprecated since * 2011, and will be disallowed by NIST as of 2014. Please refer to the following * document for more information: * * http://csrc.nist.gov/publications/nistpubs/800–131A/sp800–131A.pdf * * If you are uncertain about identity providers supporting SHA-256 or other * algorithms of the SHA-2 family, you can configure it individually in the * IdP-remote metadata set for those that support it. Once you are certain that * all your configured IdPs support SHA-2, you can safely remove the configuration * options in the IdP-remote metadata set and uncomment the following option. * * Please refer to the hosted SP configuration reference for more information. */</pre><pre>‘signature.algorithm’ =&gt; ‘http://www.w3.org/2001/04/xmldsig-more#rsa-sha256’,</pre><pre>/* * The attributes parameter must contain an array of desired attributes by the SP. * The attributes can be expressed as an array of names or as an associative array * in the form of ‘friendlyName’ =&gt; ‘name’. * The metadata will then be created as follows: * &lt;md:RequestedAttribute FriendlyName=”friendlyName” Name=”name” /&gt; */ /*’attributes’ =&gt; array( ‘attrname’ =&gt; ‘urn:oid:x.x.x.x’, ),*/ /*’attributes.required’ =&gt; array ( ‘urn:oid:x.x.x.x’, ),*/ ),</pre><p><strong>Drupal Configuration:</strong></p><ol><li>Download the Simplesamlphp_auth module and External Authentication module</li><li>Run composer drupal update command so that all the library required for simplesamlphp_auth module gets downloaded in the docroot/vendor folder.</li><li>Enable the module.</li><li>Navigate to Administration &gt; Configuration &gt; People &gt; Simplesamlphp_auth (<a href="http://yoursite/admin/config/people/simplesamlphp_auth">http://yoursite/admin/config/people/simplesamlphp_auth</a>)</li></ol><ul><li><strong>Basic Settings</strong>: tick the <strong>Activate authentication via SimpleSAMLphp</strong>. This should be checked to activate the simplesamlphp integration with Drupal.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*ubKixVxZwOHxXgDr.png" /></figure><ul><li><strong>Local Authentication:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oKjtqvoqDBiGJxxh.png" /></figure><ul><li><strong>User Info and Syncing:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/0*MQ-GSJXy0sS6VkSa.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qDvmNLT32A26ha-1.png" /></figure><p>Add the following snippet to <strong>.htaccess</strong></p><pre>RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics.php$</pre><pre># Allow access to simplesaml paths+ RewriteCond %{REQUEST_URI} !^/simplesaml</pre><pre># Deny access to any other PHP files that do not match the rules above.</pre><pre>RewriteRule “^.+/.*\.php$” — [F]</pre><p>After saving the configuration add the following snippet in <strong>settings.php</strong>. It is mandatory</p><pre>// SimpleSAMLphp configuration# Provide universal absolute path to the installation.</pre><pre>if (isset($_ENV[‘AH_SITE_NAME’]) &amp;&amp; is_dir(‘/var/www/html/’ . $_ENV[‘AH_SITE_NAME’] . ‘/simplesamlphp-1.14.8’)) { $settings[‘simplesamlphp_dir’] = ‘/var/www/html/’ . $_ENV[‘AH_SITE_NAME’] . ‘/simplesamlphp-1.14.8’;}else {</pre><pre>// Local SAML path. if (is_dir(DRUPAL_ROOT . ‘/../simplesamlphp-1.14.8’)) { $settings[‘simplesamlphp_dir’] = DRUPAL_ROOT . ‘/../simplesamlphp-1.14.8’; }}</pre><pre>// SimpleSAMLphp_auth module settings$config[‘simplesamlphp_auth.settings’] = [</pre><pre>// Basic settings. ‘activate’ =&gt; TRUE,</pre><pre>// Enable or Disable SAML login.<br>‘auth_source’ =&gt; ‘default-sp’, </pre><pre>‘login_link_display_name’ =&gt; ‘Login with your SSO account’,</pre><pre>‘register_users’ =&gt; TRUE,</pre><pre>‘debug’ =&gt; FALSE,</pre><pre>// Local authentication.</pre><pre>‘allow’ =&gt; array( ‘default_login’ =&gt; TRUE,</pre><pre>‘set_drupal_pwd’ =&gt; TRUE,</pre><pre>‘default_login_users’ =&gt; ‘’,</pre><pre>‘default_login_roles’ =&gt; array( <br>‘authenticated’ =&gt; FALSE,<br>‘administrator’ =&gt; ‘administrator’, ), ),</pre><pre>‘logout_goto_url’ =&gt; ‘’,</pre><pre>// User info and syncing.</pre><pre>// ‘unique_id’ the value which is unique in the saml response coming from IDP. ‘unique_id’ =&gt; ‘mail’,</pre><pre>‘user_name’ =&gt; ‘username’,</pre><pre>‘mail_attr’ =&gt; ‘mail’,</pre><pre>‘sync’ =&gt; array( ‘mail’ =&gt; TRUE, ‘user_name’ =&gt; TRUE, ),</pre><pre>];</pre><p>Now hit <a href="http://example.com/saml_login">http://example.com/saml_login</a> (SP Site) it should redirect to your (IDP Site)url. After redirecting to the site which is set as IDP, you need to login using (name and password).Hit the Sign in button,you will be again redirected to your (SP Site).Now if you go to you IDP Site you can see that you are logged in to that site too.</p><p>This is what SimpleSAMLPhp all about.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ab9a337120b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/valuebound/how-to-configure-single-sign-on-across-multiple-drupal-8-platforms-or-websites-1ab9a337120b">How to Configure Single Sign On across Multiple Drupal 8 Platforms or Websites ?</a> was originally published in <a href="https://medium.com/valuebound">Valuebound</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>