{"id":236,"date":"2023-12-06T18:32:41","date_gmt":"2023-12-06T18:32:41","guid":{"rendered":"https:\/\/rexbarkdoll.com\/rexbarkdoll\/?p=236"},"modified":"2025-12-23T02:44:58","modified_gmt":"2025-12-23T02:44:58","slug":"integrating-simplesamlphp-with-drupal-using-drupalauth4ssp-and-simplesamlphp_auth-for-idp-and-sp-sites","status":"publish","type":"post","link":"https:\/\/rexbarkdoll.com\/rexbarkdoll\/2023\/12\/06\/integrating-simplesamlphp-with-drupal-using-drupalauth4ssp-and-simplesamlphp_auth-for-idp-and-sp-sites\/","title":{"rendered":"Integrating SimpleSAMLphp with Drupal using drupalauth4ssp and simplesamlphp_auth for IdP and SP sites"},"content":{"rendered":"\n<p>This guide (and its title) is so long because this is the level of detail and explanation I needed when I started learning about SAML and Drupal. It was hard to find anything that gave me the what and the why of how SAML worked and how I could successfully integrate it with my Drupal websites. My hope is that you can always ignore what you don&#8217;t need and appreciate everything else.<\/p>\n\n\n\n<p><strong>The goal of this guide<\/strong> is to help you understand SAML and Drupal enough to setup and maintain Single Sign-On connections between your Identity Provider (IdP) and Service Providers (SP).<\/p>\n\n\n\n<p><strong>Disclaimer:<\/strong> I am not claiming to be an expert ad SAML, Drupal, or anything else. Implement this at your own risk and expense. The guide provided below is simply my learned experience from my own implementations and I cannot guarantee your success. You still have to learn your own lessons.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-Drupal-integration.pdf\">Download this guide as a PDF<\/a><\/div>\n<\/div>\n\n\n\n<p><strong>CONTENTS<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"#1\">Introduction<\/a><\/li>\n\n\n\n<li><a href=\"#2\">Scope<\/a><\/li>\n\n\n\n<li><a href=\"#3\">Specific Procedures<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#32\">Dependencies<\/a><\/li>\n\n\n\n<li><a href=\"#32\">Background<\/a><\/li>\n\n\n\n<li><a href=\"#33\">How do I set up a new [external] SP?<\/a><\/li>\n\n\n\n<li><a href=\"#34\">How do I set up a new [internal] SP?<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#4\">Follow up actions<\/a><\/li>\n\n\n\n<li><a href=\"#5\">Resources<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#51\">Related or Useful Resources<\/a><\/li>\n\n\n\n<li><a href=\"#52\">Troubleshooting SAML<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#6\">Appendices<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#61\">File and Code Examples<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"1\" name=\"1\">1. Introduction<\/a><\/h2>\n\n\n\n<p>This guide is designed to help you understand SAML (using SimpleSAMLphp v2.1+), why we use it, and how it works to serve website users. The only outputs are a working SAML connection between two points \u2013 the IdP (Identity Provider) and the SP (Service Provider). <\/p>\n\n\n\n<p><strong>Why Single Sign-On with SAML? <\/strong>SAML allows us to create a single-sign-on experience for our users so that they only have to remember one password for multiple sites. Over the years, users I&#8217;ve served have been extremely frustrated when they\u2019ve needed to reset a password on one site, only to find out that they weren\u2019t resetting the correct one for what they thought were trying to access. My goal is to simplify my environment for them so that they only have to remember account information in one place, and they can access all website services appropriately.<\/p>\n\n\n\n<p><strong>SAML Security: <\/strong>SAML connections are manually established between the IdP and SP over secure, encrypted connections. Both sides MUST exchange information and configure their connections; no SAML connections are able to be established in a one-sided manor.<\/p>\n\n\n\n<p><strong>Assumptions:<\/strong> This guide is written from the perspective of a LAMP stack (Ubuntu Linux, Apache 2.4, PHP 8.1+, MySQL). Your environment may be different, so, when you&#8217;re doing some of the Apache-related tasks, check for what the best methods are for your system. Second, I have no experience with NGINX, so I can&#8217;t describe how that works differently from Apache. Other tutorials I found on the internet give guidance for that kind of environment, so you should be able to find a comparable example if that&#8217;s what you are running.<\/p>\n\n\n\n<p>Additionally, in 2024 and beyond, you should be using Drupal version 10+, Drush version 12+, and Composer version 2.6+. While many of these settings will work for Drupal 8+, those versions are no longer supported with security updates and should be upgraded to the latest stable version of Drupal immediately. SimpleSAMLphp is using version 2.1+ for this tutorial.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"2\" name=\"2\">2. Scope<\/a><\/h2>\n\n\n\n<p>The SCOPE of SAML is that it is installed as a component of our Drupal websites. In the IdP, it is required as a dependency of the <a href=\"https:\/\/www.drupal.org\/project\/drupalauth4ssp\">drupalauth4ssp module<\/a> and in the SP\u2019s it is required as a dependency of the <a href=\"https:\/\/www.drupal.org\/project\/simplesamlphp_auth\">simplesamlphp_auth module<\/a>. In both cases SimpleSAMLphp is found in each site\u2019s <code>[site root]\/vendor\/simplesamlphp*<\/code> folder. In addition, we create each site&#8217;s configuration files in the <code>[site root]\/simplesamlphp\/dev*<\/code> folder in each directory. There\u2019s also additional information in the <code>\/etc\/apache2\/sites-available\/*.conf<\/code> files.<\/p>\n\n\n\n<p>SAML\u2019s operating scope is to provide seamless communication between the IdP and the SP\u2019s. All of these connections are managed within the above folder structures and work is done mostly at the command line\/FTP level with some work being done in Drupal for the User information being passed back and forth.<\/p>\n\n\n\n<p><strong>*NOTE:<\/strong> I&#8217;ll be using the following variables throughout this tutorial:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>[site root]<\/strong><\/code> = this is equivalent to the root directory for your website. If you&#8217;re running Drupal, then it is whichever directory the web\/ folder is residing in. The assumption is that all [site root] references should be accessed from the command line or FTP<\/li>\n\n\n\n<li><code><strong>[your site]<\/strong><\/code> = this is the domain name or subdomain your website resolves to when accessing via an internet browser like Chrome or Firefox.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"3\" name=\"3\">3. Specific Procedures<\/a><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"31\" name=\"31\">3.1.&nbsp; Dependencies<\/a><\/h3>\n\n\n\n<p>The way to have SAML setup, is to have it required as a dependency of Drupal. Therefore, a good working knowledge of <a href=\"https:\/\/getcomposer.org\/\">Composer<\/a>, <a href=\"https:\/\/www.drush.org\/latest\/\">Drush<\/a>, and <a href=\"https:\/\/www.drupal.org\/\">Drupal<\/a>\u2019s user login and access management system (Roles) is needed.<\/p>\n\n\n\n<p>Beyond that, a developer should have at least a basic understanding of what SAML is doing and why.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"32\" name=\"32\">3.2. Background<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-graphic-2400px-1024x512.jpg\" alt=\"an example of a user requesting to log into a service provider, getting redirected to the identity provider for authentication and being returned, logged in, upon successful login\" class=\"wp-image-224\" srcset=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-graphic-2400px-1024x512.jpg 1024w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-graphic-2400px-300x150.jpg 300w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-graphic-2400px-768x384.jpg 768w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-graphic-2400px-1536x768.jpg 1536w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-graphic-2400px-2048x1024.jpg 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>SAML connects the IdP (Identity Provider) and SP (Service Provider) in a manually established, secure connection. The above infographic shows how a user requests authentication at an SP authentication URL (for example: <code>https:\/\/[your sp site]\/saml_login<\/code>). The user is then directed to the IdP login page and is asked to setup an account or enter their credentials(for example: <code>https:\/\/[your idp site]\/user\/login<\/code>). Once they can authenticate, their request is checked against the user database (in this case, in Drupal) and they are either rebuffed or sent back to the SP with a token if successful. The token tells the SP that the IdP has successfully verified this user and gives the SP some basic information about the user for account management on the SP side if needed (we mostly care about roles).<\/p>\n\n\n\n<p>Our SAML is setup to store\/manage these authentication tokens in our MySQL database. You may care to research alternative methods for your situation and security needs.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"321\" name=\"321\">3.2.1.&nbsp; Understanding how SimpleSAML IdP\u2019s and SP\u2019s work<\/a><\/h4>\n\n\n\n<p><strong>Setting up a Drupal site to become an IdP or SP:<\/strong><\/p>\n\n\n\n<p>First determine which site is going to be which, I suggest drawing yourself a diagram. If you\u2019re setting up multiple sites and you know which one is going to be the one where people login and authenticate, that\u2019s going to be your IdP \u2013 where you do all your user management \u2013 and everything else is going to be an SP.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-map-2k-1024x512.jpg\" alt=\"\" class=\"wp-image-225\" srcset=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-map-2k-1024x512.jpg 1024w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-map-2k-300x150.jpg 300w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-map-2k-768x384.jpg 768w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-map-2k-1536x768.jpg 1536w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SAML-map-2k.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In a best-case scenario, you might want to think about making the IdP its own subdomain like idp.domain.com, then all your other websites will resolve to their own subdomains (sp1.domain.com, intranet.domain.com, community.domain.com) and your main website will resolve at domain.com. This allows you to have really focused user management controls on your IDP site and disable <em>local <\/em>user login on all other sites so that you don\u2019t need all the additional authentication and protection components that your IdP does (reducing attack surfaces).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"322\" name=\"322\">3.2.2. Setting up a Drupal site to be an Identity Provider (IdP)<\/a><\/h4>\n\n\n\n<p>To add the correct SAML components to your IdP, you need to go to the command line and run: <code>composer require \u2018drupalauth\/simplesamlphp-module-drupalauth:^2.10@RC\u2019 \u2018drupal\/drupalauth4ssp:^2.0@RC\u2019<\/code><\/p>\n\n\n\n<p>This will install the SimpleSAMLphp drupalauth module into your <code>[site root]\/vendor\/simplesamlphp\/simplesamlphp\/modules<\/code> folder (it makes communication between Drupal and SimpleSAMLphp possible), followed by the <a href=\"https:\/\/www.drupal.org\/project\/drupalauth4ssp\">DrupalAuth4SSp module<\/a> into Drupal. Next, enable DrupalAuth4SSp with drush:<br><code>drush en drupalauth4ssp<\/code><\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><a id=\"3221\" name=\"3221\">3.2.2.1.&nbsp;IdP Drupal Settings<\/a><\/h5>\n\n\n\n<p>If your IdP is a Drupal website, it needs to leverage the <a href=\"https:\/\/www.drupal.org\/project\/drupalauth4ssp\">drupalauth4ssp module<\/a> to connect the Drupal website to SimpleSAMLphp. The setup within Drupal is very simple, with only one module configuration page: (<code>https:\/\/[your site]\/admin\/config\/people\/drupalauth4ssp<\/code>).<\/p>\n\n\n\n<p>The <strong>allowed list of ReturnTo Parameters<\/strong> is limited to the SP\u2019s we trust and are connected to. By default, this uses an asterisk (*) to allow for returning to any SP that we\u2019ve connected to. Leaning toward a more secure posture, I suggest explicitly naming which SP\u2019s you are connecting to.<\/p>\n\n\n\n<p>I don\u2019t set the IdP-Initiated logout redirect URL mostly because I&#8217;ve been happy returning people to the home page after they log out.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"914\" src=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/drupalauth4ssp-settings-1024x914.png\" alt=\"\" class=\"wp-image-226\" srcset=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/drupalauth4ssp-settings-1024x914.png 1024w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/drupalauth4ssp-settings-300x268.png 300w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/drupalauth4ssp-settings-768x686.png 768w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/drupalauth4ssp-settings.png 1344w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"323\" name=\"323\">3.2.3.&nbsp; IDP SAML Files<\/a><\/h4>\n\n\n\n<p>In this section, we look at what it takes to setup SAML to work in conjunction with Drupal. We\u2019ll be focusing on the needs of SAML at this point, since the Drupal side of things should be in a good place on the IdP and we&#8217;ll be setting the SP Drupal settings up in just a bit.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><a id=\"3231\" name=\"3231\">3.2.3.1. Apache Config Files<\/a><\/h5>\n\n\n\n<p>In order for your SAML to be made available to the internet, you need to create a symlink or alias for it. Here, you also make simplesamlphp\u2019s public directory open to the public. This is intentional, the public directory is designed to be a web user interface for SAML management.<\/p>\n\n\n\n<p>The files you need are the .conf files, found in <code>\/etc\/apache2\/sites-available\/[website].conf<\/code><\/p>\n\n\n\n<p>When you edit one of these .conf files, you\u2019ll need to create a section inside your site&#8217;s &lt;virtualhost&gt; tags (probably at the bottom), for SAML with the following parameters.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code># ****************************************<br># SIMPLSSAMLPHP SETTINGS<br># ****************************************<\/code><br><br><code># ENVIRONMENT VARIABLES<br># Point the config directory to a custom directory that won\u2019t get overridden by composer updates<\/code><br><code>SetEnv SIMPLESAMLPHP_CONFIG DIR \/var\/www\/html\/[site root]\/simplesamlphp\/dev\/config<\/code><br><br><code># Set an alias to the SimpleSAML directory<\/code><br><code># In some systems this is setup as a symlink, but I prefer this method.<\/code><br><code>Alias \/idp \/var\/www\/html\/[site root]\/vendor\/simplesamlphp\/simplesamlphp\/public<\/code><br><code># OR for SP:<\/code><br><code># Alias \/simplesaml \/var\/www\/html\/[site root]\/vendor\/simplesamlphp\/simplesamlphp\/public<\/code><br><br><code># Set Access Rights<\/code><br><code>&lt;Directory \/var\/www\/html\/[site root]\/vendor\/simplesamlphp\/simplesamlphp\/public&gt;<br>&nbsp;&nbsp;&nbsp; &lt;IfModule mod_authz_core.c&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # For Apache 2.4<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Require all granted<br>&nbsp;&nbsp;&nbsp; &lt;\/IfModule&gt;<br>&lt;\/Directory&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The first block of code sets a SimpleSAMLphp environment variable that tells SimpleSAMLphp in the <code>\/var\/www\/html\/[site root]\/vendor\/simplesamlphp\/simplesamlphp<\/code> directory to look in <code>\/var\/www\/html\/[site root]\/simplesamlphp\/dev\/config<\/code> directory for all configuration settings.<\/p>\n\n\n\n<p>Why do this? Because we don\u2019t want Composer overwriting our configuration settings with default code and breaking SAML whenever it has an update (believe me, that\u2019s frustrating). This puts all the SAML settings in a location we control.<\/p>\n\n\n\n<p>The next piece sets an alias for the directory: <br><code>\/var\/www\/html\/<strong>[site root]<\/strong>\/vendor\/simplesamlphp\/simplesamlphp\/public<\/code> to resolve at <code>https:\/\/<strong>[IdP site root]<\/strong>\/idp<\/code> or <code>https:\/\/<strong>[SP site root]<\/strong>\/simplesaml<\/code> for SP&#8217;s. This is SAML\u2019s web-facing interface where we can check on the operability of our SAML, test authentication methods, and convert metadata. (note, you can also do this with a symbolic link, described in other tutorials. I find symlinks to be troublesome, so I use this method.)<\/p>\n\n\n\n<p>Last, we set view access rights by allowing the public directory access to the greater internet.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"324\" name=\"324\">3.2.4. The Local IdP &amp; SP Configuration Settings<\/a><\/h4>\n\n\n\n<p><strong>NOTE:<\/strong> This section applies to both the IdP AND SP setups. Understanding it and setting it up is critical to your success.<\/p>\n\n\n\n<p><strong>Current Location: \/var\/www\/html\/[site root]\/simplesamlphp\/dev\/<\/strong><\/p>\n\n\n\n<p>You\u2019re probably wondering where this directory came from. You must create it and copy some files from your <code>\/var\/www\/html\/<strong>[site root]<\/strong>\/vendor\/simplesamlphp\/simplesamlphp\/<\/code> folders.<\/p>\n\n\n\n<p>Here\u2019s the folder structure you want:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/var\/www\/html\/<strong>&#91;site root]<\/strong>\/<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>simplesamlphp\/\n<ul class=\"wp-block-list\">\n<li>dev\/\n<ul class=\"wp-block-list\">\n<li>certs\/\n<ul class=\"wp-block-list\">\n<li>certificate.pem (you generate this)<\/li>\n\n\n\n<li>certificate.crt (you generate this)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>config\/\n<ul class=\"wp-block-list\">\n<li>authsources.php (copy from vendor folder)<\/li>\n\n\n\n<li>config.php (copy from vendor folder)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>data\/<\/li>\n\n\n\n<li>log\/<\/li>\n\n\n\n<li>metadata\/\n<ul class=\"wp-block-list\">\n<li>saml20-idp-hosted.php (copy from vendor folder)<\/li>\n\n\n\n<li>saml20-idp-remote.php (copy from vendor folder)<\/li>\n\n\n\n<li>saml20-sp-remote.php (copy from vendor folder)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>tmp\/<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>prod\/\n<ul class=\"wp-block-list\">\n<li>certs\/\n<ul class=\"wp-block-list\">\n<li>certificate.pem (you generate this)<\/li>\n\n\n\n<li>certificate.crt (you generate this)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>config\/\n<ul class=\"wp-block-list\">\n<li>authsources.php (copy from vendor folder)<\/li>\n\n\n\n<li>config.php (copy from vendor folder)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>data\/<\/li>\n\n\n\n<li>log\/<\/li>\n\n\n\n<li>metadata\/\n<ul class=\"wp-block-list\">\n<li>saml20-idp-hosted.php (copy from vendor folder)<\/li>\n\n\n\n<li>saml20-idp-remote.php (copy from vendor folder)<\/li>\n\n\n\n<li>saml20-sp-remote.php (copy from vendor folder)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>tmp\/<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>Apache should have access to the data\/, log\/, and tmp\/ folders.<\/p>\n\n\n\n<p><strong>Note <\/strong>that in your Apache .conf settings, the <code>dev\/<\/code> portion above should be updated to <code>prod\/<\/code> when you go to production. You can point to one or the other depending on the environment you\u2019re in.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><a id=\"3241\" name=\"3241\">3.2.4.1. Certificates<\/a><\/h5>\n\n\n\n<p><strong>Current Location: \/var\/www\/html\/[site root]\/simplesamlphp\/dev\/certs<\/strong><\/p>\n\n\n\n<p>Your encryption certificates live in this folder.<\/p>\n\n\n\n<p>If you are reading this, please stop and set yourself a calendar reminder right now for a week or two before YOUR certificates expire to reissue them and update all your SP\u2019s with new metadata.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Mini Tutorial: Creating Certificates<\/strong> <br><strong>Note:<\/strong> The file names for both certificates below can be named anything, you may want to be more descriptive than the examples provided below. <br><br>In the command line, go to your certs directory:<br><code>\/var\/www\/html\/<strong>[IdP site root]<\/strong>\/simplesamlphp\/dev\/certs <\/code><br><br>Run the following command to generate some X.509 certificates for the IdP. <br><code>openssl req -newkey rsa:3072 -new -x509 -days 3652 -nodes -out idp_simplesaml.crt -keyout idp_simplesaml.pem<\/code><br><br>You only need to create the IdP certificates when you set it up or need to renew the certificates. Now, head to the same directory in your SP:<br><code>\/var\/www\/html\/<strong>[SP site root]<\/strong>\/simplesamlphp\/dev\/certs<\/code><br><br>And generate a new certificate as well.<br><code>openssl req -newkey rsa:3072 -new -x509 -days 3652 -nodes -out sp_<code>simplesaml<\/code>.crt -keyout sp_<code>simplesaml<\/code>.pem<\/code> <br><br>These certificates should NOT be stored in a Git repository. Because they are essentially authentication and encryption credentials, they pose a security risk that shouldn\u2019t be maintained in a publicly accessible place.<br><br>One option is to place them in a more secure place and create a symbolic link in your certs directory during the deployment process so that the system thinks they\u2019re in the right place. Additionally, these certs last for 3652 days or about 10 years.<br><br>This might not be the best practice but should be okay for a locked down Dev server. Rotating certificates every 1-5 years for production is what I\u2019m seeing.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\"><a id=\"3242\" name=\"2342\">3.2.4.2. Authsources.php<\/a><\/h5>\n\n\n\n<p><strong>Current Location: \/var\/www\/html\/[site root]\/simplesamlphp\/dev\/config<\/strong><\/p>\n\n\n\n<p>The Authsources file defines where SimpleSAMLphp looks for users to be authenticated (the user database). I typically only have one Authentication source.  It uses Drupal\u2019s login page for authentication.<\/p>\n\n\n\n<p><em>In the past, I had an experience where there was an update that broke something, and we did setup the another Authsource which used SimpleSAMLphp\u2019s login page to authenticate users instead of Drupal&#8217;s. It still checked Drupal&#8217;s user database, but required that I theme the SimpleSAMLphp UI to look like our website.<\/em><\/p>\n\n\n\n<p><em>I do not recommend this because even though the SimpleSAMLphp documentation says you can create your own theme, the only way I could find do to it was by overwriting the original SAML files instead of the system allowing me to create a custom theme module like you&#8217;re supposed to do. This means that whenever SimpleSAMLphp updates its code, Composer would overwrite the UI changes. Fortunately, I found a fix for the Drupalauth4ssp module and was able to go back to using the Drupal login page and authsource:drupal-userpass before we ran into any other issues.<\/em><\/p>\n\n\n\n<p>An example of the authsources.php file can be found in the Appendices at the end of this webpage. Note that additional code comments explaining things are in the actual file but have been stripped out here for brevity.<\/p>\n\n\n\n<p>One important thing to know about the attributes array is that if a user has not filled in a field in their user profile, the field will simply not show up when you are <strong>testing <\/strong>federated sources or when a connection is sent to an SP. So, if you need to test and make sure all fields are populating, make sure that those fields are all filled in on the user account on the IdP you\u2019re testing the connection with.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><a id=\"3243\" name=\"3243\">3.2.4.3. The Config.php file<\/a><\/h5>\n\n\n\n<p>Config file is where the primary SAML config settings live. There\u2019s a lot in this file to know about. I\u2019m going to break it down, section by section. In addition, in the example code found in the Appendices, I&#8217;m going to highlight the parts of the file I think you should pay special attention to.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Basic Configuration Options<\/strong>\n<ul class=\"wp-block-list\">\n<li>Know about all of these, you want to make sure that your <strong>baseurlpath<\/strong> is the same as the alias setup in the <code>\/etc\/apache2\/sites-available\/.conf<\/code> files<\/li>\n\n\n\n<li>The directories for logging, temp, certs, are all absolute in my current version, but they can be relative. I just wanted to be sure of where the files were going to end up and the relative URLs were confusing while I was learning. I\u2019m still not sure if relative URLs are based from the site root, SAML\u2019s public root (<code>[site root]\/vendor\/simplesamlphp\/simplesamlphp\/public<\/code>), or another directory, so absolute file locations is better for me.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Security Configuration Options<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Secret Salt<\/strong> \u2013 if you change this, it\u2019s bad news for logged in users. It doesn\u2019t need to change, so best to leave it alone unless you\u2019re worried about a security breach issue.<\/li>\n\n\n\n<li><strong>auth.adminpassword<\/strong> sets the password for SAML\u2019s core auth module, we should improve this password at some point and probably set different ones for each site\/SP &amp; the IdP.<\/li>\n\n\n\n<li><strong>trusted.url.domains<\/strong> &#8211; which domains we trust to connect to. This is like defaulting all ports on a server to closed and manually opening them up if you want them open.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Errors and Debugging<\/strong>\n<ul class=\"wp-block-list\">\n<li>Turn on or off visible errors. I recommend leaving off most of the time. <\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Logging and Statistics<\/strong>\n<ul class=\"wp-block-list\">\n<li>Important for troubleshooting and security management<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Proxy Configuration<\/strong>\n<ul class=\"wp-block-list\">\n<li>Ignored, no proxy at the moment.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Database Configuration<\/strong>\n<ul class=\"wp-block-list\">\n<li>We do use MySQL to manage all our SAML cookies. Seems to work reliably without much system burden.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Protocols<\/strong>\n<ul class=\"wp-block-list\">\n<li>If you&#8217;re looking at the IDP, we want the saml20-idp to be true<\/li>\n\n\n\n<li>for the SP, saml20-idp should be false.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Modules<\/strong>\n<ul class=\"wp-block-list\">\n<li>We want to enable:\n<ul class=\"wp-block-list\">\n<li><strong style=\"color: initial;\">Core <\/strong><span style=\"color: initial;\">\u2013 runs SAML as a service<\/span><\/li>\n\n\n\n<li><strong>SAML <\/strong>\u2013 runs SAML as a service<\/li>\n\n\n\n<li><strong>Admin <\/strong>\u2013 grants access to the SAML login page at<\/li>\n\n\n\n<li><strong>Cron <\/strong>\u2013 runs cron<\/li>\n\n\n\n<li><strong>Drupalauth <\/strong>\u2013 provides the necessary code to authenticate using Drupal\u2019s user database<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Session Configuration<\/strong>\n<ul class=\"wp-block-list\">\n<li>These settings determine how long user sessions last (default is 8 hours)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Memcache configuration<\/strong>\n<ul class=\"wp-block-list\">\n<li>Not used<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Language and Internationalization<\/strong>\n<ul class=\"wp-block-list\">\n<li>Language settings for SAML, not really used.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Appearance<\/strong>\n<ul class=\"wp-block-list\">\n<li>It\u2019s possible to theme SAML, but for the most part, we ignore these settings since Developers are the only ones to see the SAML pages<\/li>\n\n\n\n<li>Theme.use \u2013 If you do choose to override the SAML theme, you\u2019ll need to change this setting.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Discovery Service<\/strong>\n<ul class=\"wp-block-list\">\n<li>Never changed these settings \/ left as default<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Authentication Processing Filters<\/strong>\n<ul class=\"wp-block-list\">\n<li>Never changed these settings \/ left as default<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Metadata Configuration<\/strong>\n<ul class=\"wp-block-list\">\n<li>Never changed these settings \/ left as default<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Data Store Configuration<\/strong>\n<ul class=\"wp-block-list\">\n<li>The store.sql settings are important, they connect to the MySQL database we use for SAML token storing.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>The other contact information should lead to somewhere people can contact.<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\"><a id=\"3244\" name=\"3244\">3.2.4.4. Metadata<\/a><\/h5>\n\n\n\n<p><strong>Current Location: \/var\/www\/html\/[site root]\/simplesamlphp\/dev\/metadata\/<\/strong><\/p>\n\n\n\n<p>The metadata folder holds three important files:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Saml20-idp-hosted.php<\/strong> \u2013 more settings for the IdP<\/li>\n\n\n\n<li><strong>Saml20-idp-hosted.php<\/strong> \u2013 the metadata for all the SP\u2019s that connect to the IdP<\/li>\n\n\n\n<li><em><strong>Saml20-idp-remote.php<\/strong> <\/em>\u2013 only SP\u2019s care about this file, ignore it in the IdP<\/li>\n<\/ul>\n\n\n\n<p>This file is probably the one you\u2019ll edit somewhat regularly when you setup new SPs. You have to convert their metadata to flat-file\/PHP (not XML) code and then add it to this file.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><a id=\"32441\" name=\"32441\">3.2.4.4.1. IdP Metadata<\/a><\/h5>\n\n\n\n<p>The IdP cares about two sets of metadata. The first is the <code>saml20-idp-hosted.php<\/code> file. My understanding is the hosted file means the IdP user database is collocated with this instance of SimpleSAMLphp. Then there\u2019s the <code>saml20-sp-remote.php<\/code> file, which contains each SP\u2019s metadata.<\/p>\n\n\n\n<p><strong>saml20-idp-hosted.php<\/strong><\/p>\n\n\n\n<p>This file identifies the certificates and authsource that will be used for the IdP.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code>&lt;?php $metadata['<strong>ENTITYID<\/strong>'] = [<br>&nbsp; &nbsp; 'host' =&gt; '__DEFAULT__',<br>&nbsp; &nbsp; 'privatekey' =&gt; '<strong>idp-cert<\/strong>.pem',<br>&nbsp; &nbsp; 'certificate' =&gt; '<strong>idp-cert<\/strong>.crt',<br>&nbsp; &nbsp; \/\/NOTE: AUTHSOURCE IS SET HERE<br>&nbsp; &nbsp; 'auth' =&gt; '<strong>drupal-userpass<\/strong>',<br>];<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>saml20-sp-remote.php<\/strong><\/p>\n\n\n\n<p>This file contains the metadata for each SP. I&#8217;ve provided example code in the Appendices at the end of this page. What you need to know is that whenever you need to add a new Service Provider to your IdP, you\u2019ll add their flat-file (php) metadata to this page.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"325\" name=\"325\">3.2.5 Test your SimpleSAMLphp setup<\/a><\/h4>\n\n\n\n<p>Congratulations, if everything has gone correctly with your file changes, you should have a working SimpleSAMLphp setup. Let&#8217;s find out how you did:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Start by going to <code>https:\/\/[your site]\/idp<\/code><\/li>\n\n\n\n<li>This should bring up SimpleSaml\u2019s default welcome page (yay! You have SAML working!)<\/li>\n\n\n\n<li>Now go to <code>[your_site]\/simplesaml\/admin<\/code>\n<ul class=\"wp-block-list\">\n<li>This will take you to the SAML login page IF you have the auth module enabled in the config file.<\/li>\n\n\n\n<li>Login with the password you set in your config.php file<\/li>\n\n\n\n<li>You\u2019ll see a <strong>Configuration<\/strong> page with some basic stats about your SAML installation.<\/li>\n\n\n\n<li><strong>Federation<\/strong> \u2013 this is where you see your IdP and SP metadata\n<ul class=\"wp-block-list\">\n<li>There\u2019s a box at the top of the screen with your site\u2019s metadata, click the grey arrow at the bottom of the box to expand it and see the data.<\/li>\n\n\n\n<li>When you need your IdP&#8217;s Metadata, that can be found here in the third block of code, titled <strong>SimpleSAMLphp Metadata<\/strong><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>The <strong>Test<\/strong> page allows you to test your authentication sources. Once you\u2019ve added your SP\u2019s metadata to the IdP\u2019s saml20-sp-remote.php file, you should be able to test the connection from here.<br><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"210\" class=\"wp-image-232\" style=\"width: 600px;\" src=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml-test-page.png\" alt=\"\" srcset=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml-test-page.png 1822w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml-test-page-300x105.png 300w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml-test-page-1024x359.png 1024w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml-test-page-768x269.png 768w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml-test-page-1536x538.png 1536w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/li>\n\n\n\n<li><strong>Admin<\/strong> \u2013 SAML\u2019s admin login credentials<\/li>\n\n\n\n<li><strong>default-sp<\/strong> \u2013 this should connect to Drupal\n<ol class=\"wp-block-list\">\n<li>click on the link. It may ask you to sign into the main website<\/li>\n\n\n\n<li>If you authenticate successfully, it will return you to a SimpleSAMLphp page that shows all the attributes in your user account that were passed from Drupal to SAML when you logged in. (remember, from the authsources.php file?)<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"855\" src=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml-test-page-drupalauth-1024x855.png\" alt=\"\" class=\"wp-image-233\" srcset=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml-test-page-drupalauth-1024x855.png 1024w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml-test-page-drupalauth-300x250.png 300w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml-test-page-drupalauth-768x641.png 768w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml-test-page-drupalauth-1536x1282.png 1536w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml-test-page-drupalauth.png 1924w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Seeing all your attributes means that your SAML connection with your Drupal IdP site is setup successfully!\n<ul class=\"wp-block-list\">\n<li>If you\u2019re not getting this page, it means that something between the SP and the IdP isn\u2019t setup properly and there\u2019s an error. I would review all your code settings and see if there are any mismatches.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"326\" name=\"326\">3.2.6 The IdP Setup and Completion Checklist<\/a><\/h4>\n\n\n\n<p>At this point, you should have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In your server:\n<ul class=\"wp-block-list\">\n<li>Your apache .conf file setup to make SimpleSAMLphp&#8217;s public directory available to the world AND have set the <code>SetEnv SIMPLESAMLPHP_CONFIG DIR<\/code> to point to your custom simplesamlphp\/dev or \/prod directory you setup<\/li>\n\n\n\n<li>You should be able to access your IdP&#8217;s simplesamlphp in your browser at: <code>https:\/\/[your idp site]\/idp<\/code> and login at <code>https:\/\/[your idp site]\/idp\/admin<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>In SimpleSAMLphp:\n<ul class=\"wp-block-list\">\n<li>You should be able to go to the Test tab and test a connection with your IdP Drupal website.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>In Drupal:\n<ul class=\"wp-block-list\">\n<li>you should have the drupalauth4ssp module enabled<\/li>\n\n\n\n<li>You should have a &#8220;test&#8221; user account setup with all the fields you want to pass to your SP filled in<\/li>\n\n\n\n<li>Your test user should have one or more roles (beyond authenticated) to send to the SP.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"33\" name=\"33\">3.3. How do I setup a new [external] Service Provider with my SimpleSAMLphp Identity Provider?<\/a><\/h3>\n\n\n\n<p>In this section, we will setup a connection with a new service provider that is not within your own environment. This might be a company like Overdrive.com or EBSCOhost, or another service for which you want to provide your users with single sign-on option.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"331\" name=\"331\">3.3.1. Step 1:<\/a><\/h4>\n\n\n\n<p>If you\u2019re setting up a connection with a third-party service you need to send them your IdP metadata. This can be done by going to <code>https:\/\/<strong>[your site]<\/strong>\/idp<\/code> and signing in.<\/p>\n\n\n\n<p>On the Federation page, at the top, there\u2019s bolded text that says SAML 2.0 IdP Metadata. Click on the <strong>[ Show Metadata ]<\/strong> link below that text to reveal the metadata.<\/p>\n\n\n\n<p>The following images have been anonymized and do not contain real data:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"869\" src=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-1-1024x869.png\" alt=\"\" class=\"wp-image-227\" srcset=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-1-1024x869.png 1024w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-1-300x255.png 300w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-1-768x652.png 768w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-1-1536x1304.png 1536w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-1.png 1904w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"897\" src=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-2-1024x897.png\" alt=\"\" class=\"wp-image-228\" srcset=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-2-1024x897.png 1024w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-2-300x263.png 300w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-2-768x672.png 768w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-2-1536x1345.png 1536w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-2.png 1832w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"832\" src=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-3-1024x832.png\" alt=\"\" class=\"wp-image-229\" srcset=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-3-1024x832.png 1024w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-3-300x244.png 300w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-3-768x624.png 768w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-3-1536x1248.png 1536w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/SimpleSAML-Federation-3.png 1814w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>When I\u2019m sending everything over to an SP, most times they can just grab it from the Metadata URL provided at the top, but you can send the XML and flat-file versions to them via an encrypted method.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Metadata URL<\/strong> \u2013 This gives them a downloadable php file of our metadata<\/li>\n\n\n\n<li><strong>XML code<\/strong> \u2013 This is the XML version of our metadata, it\u2019s pretty descriptive compared to the PHP code, so I\u2019ve found it helpful to send in the past.<\/li>\n\n\n\n<li><strong>Flat File format (php)<\/strong> \u2013 This is what we use with SimpleSAMLphp in its files, sometimes helpful for others.<\/li>\n\n\n\n<li><strong>The Certificates<\/strong> \u2013 I tend to not send these. They\u2019re included in the Metadata and no one has ever asked for them.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"332\" name=\"332\">3.3.2. Step 2:<\/a><\/h4>\n\n\n\n<p>Once I\u2019ve sent them our IdP info, then they send us back their SP metadata and that is added to the <code>\/var\/www\/html\/<strong>[site root]<\/strong>\/simplesamlphp\/dev\/metadata\/saml20-sp-remote.php<\/code> file.<\/p>\n\n\n\n<p>Make sure to add a code comment to let your team know when the connection was setup and what service it\u2019s for.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"333\" name=\"333\">3.3.3. Step 3:<\/a><\/h4>\n\n\n\n<p>Once that\u2019s done, you can let the SP know and they should send you a URL to test the connection.<\/p>\n\n\n\n<p>They MAY send you another, official URL once this test has completed. When you have that, you can put that link wherever it makes sense to do so on your website so that users can authenticate and access the SP. I recommend running your suggestions past the chain of command before you implement.<\/p>\n\n\n\n<p>Once you\u2019ve published the links, you\u2019re good to go. Everything should be setup and working properly.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"334\" name=\"334\">3.3.4. Maintenance<\/a><\/h4>\n\n\n\n<p>Make sure you set a reminder to send updated Metadata to your SP\u2019s if your certificate expires or if your SAML goes through a major version upgrade. Our IDP metadata changed between SAML 1.9 and 2.1.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"34\" name=\"34\">3.4.\u00a0How do I setup a new [internal] Service Provider?<\/a><\/h3>\n\n\n\n<p><strong>(a subdomain website)<\/strong><\/p>\n\n\n\n<p>The process is similar to the above steps, but you\u2019re going to be doing all the work yourself instead of collaborating with an external team.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"341\" name=\"341\">3.4.1. Setting up a Drupal site to be a Service Provider (SP)<\/a><\/h4>\n\n\n\n<p>This step assumes you have installed Drupal 10+ using Composer and Drush already. In the command line, run the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>composer require \u2018simplesamlphp\/simplesamlphp:^2.1\u2019 \u2018drupalauth\/simplesamlphp-module-drupalauth:^1.9\u2019&nbsp; 'drupal\/simplesamlphp_auth:^4.0'<\/code><\/pre>\n\n\n\n<p>This installs SimpleSAMLphp, the SimpleSAMLphp DrupalAuth module, and Drupal\u2019s <a href=\"https:\/\/www.drupal.org\/project\/simplesamlphp_auth\">SimpleSAMLphp_auth module<\/a>. Enable the simplesamlphp_auth module with drush: <br><code>drush en simplesamlphp_auth<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"342\" name=\"342\">3.4.2. Apache Config Files<\/a><\/h4>\n\n\n\n<p><strong>NOTE:<\/strong> This section is a duplicate of the IdP section above. You still need to do these steps for each SP and the IdP.<\/p>\n\n\n\n<p>In order for your SAML to be made available to the internet, you need to create a symlink or alias for it. Here, you also make simplesamlphp\u2019s public directory open to the public. This is intentional, the public directory is designed to be a web user interface for SAML management.<\/p>\n\n\n\n<p>The files you need are the .conf files, found in <code>\/etc\/apache2\/sites-available\/[website].conf<\/code><\/p>\n\n\n\n<p>When you edit one of these .conf files, you\u2019ll need to create a section inside your site&#8217;s &lt;virtualhost&gt; tags (probably at the bottom), for SAML with the following parameters.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code># ****************************************<br># SIMPLSSAMLPHP SETTINGS<br># ****************************************<\/code><br><code># ENVIRONMENT VARIABLES<br># Point the config directory to a custom directory that won\u2019t get overridden by composer updates<\/code><br><code>SetEnv SIMPLESAMLPHP_CONFIG DIR \/var\/www\/html\/<strong>[site root]<\/strong>\/simplesamlphp\/dev\/config<\/code><br><br><code># Set an alias to the SimpleSAML directory<\/code><br><code># In some systems this is setup as a symlink, but I prefer this method.<\/code><br><code>Alias \/idp \/var\/www\/html\/<strong>[site root]<\/strong>\/vendor\/simplesamlphp\/simplesamlphp\/public<\/code><br><code># OR for SP:<\/code><br><code># Alias \/simplesaml \/var\/www\/html\/<strong>[site root]<\/strong>\/vendor\/simplesamlphp\/simplesamlphp\/public<\/code><br><br><code># Set Access Rights<\/code><br><code>&lt;Directory \/var\/www\/html\/<strong>[site root]<\/strong>\/vendor\/simplesamlphp\/simplesamlphp\/public&gt;<br>&nbsp;&nbsp;&nbsp; &lt;IfModule mod_authz_core.c&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # For Apache 2.4<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Require all granted<br>&nbsp;&nbsp;&nbsp; &lt;\/IfModule&gt;<br>&lt;\/Directory&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The first block of code sets a SimpleSAMLphp environment variable that tells SimpleSAMLphp in the <code>\/var\/www\/html\/<strong>[site root]<\/strong>\/vendor\/simplesamlphp\/simplesamlphp<\/code> directory to look in <code>\/var\/www\/html\/<strong>[site root]<\/strong>\/simplesamlphp\/dev\/config<\/code> directory for all configuration settings.<\/p>\n\n\n\n<p>Why do this? Because we don\u2019t want Composer overwriting our configuration settings with default code and breaking SAML whenever it has an update (believe me, that\u2019s frustrating). This puts all the SAML settings in a location we control.<\/p>\n\n\n\n<p>The next piece sets an alias for the directory <code>\/var\/www\/html\/<strong>[site root]<\/strong>\/vendor\/simplesamlphp\/simplesamlphp\/public<\/code> to resolve at <code>https:\/\/<strong>[IdP site root]<\/strong>\/idp<\/code> or <code>https:\/\/<strong>[SP site root]<\/strong>\/simplesaml<\/code>. This is SAML\u2019s web-facing interface where we can check on the operability of our SAML, test authentication methods, and convert metadata. (note, you can also do this with a symbolic link, described in other tutorials. I find symlinks to be troublesome, so I use this method.)<\/p>\n\n\n\n<p>Last, we set view access rights by allowing the public directory access to the greater internet.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"344\" name=\"344\">3.4.4. SP Local Configuration<\/a><\/h4>\n\n\n\n<p>The best thing to do is go up to section <strong>3.2.4. The Local IdP &amp; SP Configuration Settings<\/strong>. That whole section is applicable here, just stop when you get to <strong>3.2.4.4. Metadata<\/strong> and come back here. You&#8217;ll need to make sure you&#8217;ve created the same file structure and file settings in your SP:<\/p>\n\n\n\n<p><code>[site root]\/simplesamlphp\/dev\/ [certs\/, config\/, data\/, log\/, metadata\/, tmp\/]<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"345\" name=\"345\">3.4.5. SP Metadata<\/a><\/h4>\n\n\n\n<p>SP Metadata differs from the IdP metadata because the connection is kind of reversed. You\u2019re telling your SP the IdP it will connect to. Also, one SP doesn\u2019t care about any other, so the setup is a little simpler and only needs an edit to the following file.<\/p>\n\n\n\n<p><strong>saml-idp-remote.php<\/strong><\/p>\n\n\n\n<p>This file contains the IdP\u2019s metadata. An example is provided in the Appendices at the end of this webpage. The metadata can always be acquired at the IDP\u2019s Federation tab in SimpleSAMLphp. You MUST add the IdP&#8217;s metadata to this file in order for the SAML cycle to work properly.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"346\" name=\"346\">3.4.6. Create the connection between IdP and SP<\/a><\/h4>\n\n\n\n<p>Assuming you have a brand-new site you\u2019re setting up:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Start by logging into your IdP\u2019s SAML page: <code>https:\/\/[your IdP site]\/idp<\/code>\n<ol class=\"wp-block-list\">\n<li>Login and go to the Federation Tab to grab the IdP metadata (third code block) in the box at the top of the page (shown previously). You can access it by clicking the arrow in the grey bar at the bottom of the box.<\/li>\n\n\n\n<li>Paste this metadata in your SP&#8217;s <code><strong>[sp site root]<\/strong>\/simplesamlphp\/dev\/metadata\/saml20-idp-remote.php<\/code> file, at the bottom.<br><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"480\" class=\"wp-image-230\" style=\"width: 600px;\" src=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml20-idp-remote.png\" alt=\"\" srcset=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml20-idp-remote.png 1600w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml20-idp-remote-300x240.png 300w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml20-idp-remote-1024x819.png 1024w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml20-idp-remote-768x614.png 768w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml20-idp-remote-1536x1229.png 1536w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>Go to your SP\u2019s SAML page <code>https:\/\/[your SP site]\/simplesaml<\/code>\n<ul class=\"wp-block-list\">\n<li>Go to the <strong>Federation<\/strong> tab and grab the SP\u2019s metadata near the top of the screen.<\/li>\n\n\n\n<li>Now go to your IdP\u2019s metadata directory and update the <code>[idp site root]\/simplesamlphp\/dev\/metadata\/saml20-sp-remote.php<\/code> file with the SP\u2019s metadata. (add it at the bottom, leave yourself a note about what site it\u2019s for and when you added it)<br><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"470\" class=\"wp-image-231\" style=\"width: 600px;\" src=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml20-sp-remote.png\" alt=\"\" srcset=\"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml20-sp-remote.png 1788w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml20-sp-remote-300x235.png 300w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml20-sp-remote-1024x802.png 1024w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml20-sp-remote-768x601.png 768w, https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-content\/uploads\/2023\/12\/saml20-sp-remote-1536x1203.png 1536w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>You have now given both the SP and IdP each other&#8217;s metadata which makes it possible for them to communicate with each other.<\/li>\n\n\n\n<li>In the SP site, you\u2019ll need to install\/enable the <strong>drupal\/simplesamlphp_auth module<\/strong> and enable it if you haven\u2019t done so already. Instructions for how to do this are in section <strong><a href=\"#322\">3.2.2 Setting up a Drupal site to be a Service Provider (SP)<\/a>.<\/strong><\/li>\n\n\n\n<li>Once the module has been enabled, go to your Drupal administration section and look under Configuration &gt; People &gt; SimpleSAMLphp Auth settings \u2013 or, go to<br><code>https:\/\/[your sp site]\/admin\/config\/people\/simplesamlphp_auth<\/code>\n<ul class=\"wp-block-list\">\n<li>In the <strong>Basic Settings<\/strong>, set the following fields:\n<ul class=\"wp-block-list\">\n<li><strong>Authentication source for this SP:<\/strong> default-sp<\/li>\n\n\n\n<li><strong>Authentication source for this SP:<\/strong> Login with Single Sign-On Login<\/li>\n\n\n\n<li><strong>Display a link to the Federated Login page on the user login form:<\/strong> enable this<\/li>\n\n\n\n<li><strong>User Provisioning:<\/strong> enable this<\/li>\n\n\n\n<li><strong>Security:<\/strong> Cookie only transmitted over HTTPS: enable this<\/li>\n\n\n\n<li>Save the settings<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Local authentication<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Allow authentication with Drupal accounts:<\/strong> enable this<\/li>\n\n\n\n<li><strong>Which ROLES should be allowed to login with local accounts?<\/strong> Administrators and Administrator Developers<\/li>\n\n\n\n<li>Save the settings<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>User info and syncing<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>SimpleSAMLphp attribute to be used as unique identifier for the user:<\/strong> mail<\/li>\n\n\n\n<li><strong>SimpleSAMLphp attribute to be used as username for the user:<\/strong> cn<\/li>\n\n\n\n<li><strong>Synchronize username on every login:<\/strong> enable this<\/li>\n\n\n\n<li><strong>SimpleSAMLphp attribute to be used as email address for the user:<\/strong> mail<\/li>\n\n\n\n<li><strong>Synchronize email address on every login<\/strong>: enable this<\/li>\n\n\n\n<li><strong>Automatic role population from simpleSAMLphp attributes: <\/strong>We\u2019ll come back to this later, there&#8217;s a full tutorial below (section 3.4.1).<\/li>\n\n\n\n<li><strong>Reevaluate roles every time the user logs in:<\/strong> enable this<\/li>\n\n\n\n<li><strong>Automatically enable SAML authentication for existing users upon successful login:<\/strong> enable this<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Go back to <strong>Basic Settings<\/strong> and <strong>enable <\/strong>Activate authentication via SimpleSAMLphp<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>If you haven&#8217;t yet, in your IdP, create a user account for testing purposes.<\/li>\n\n\n\n<li>To login to your SP, open an Incognito tab or different browser.\n<ul class=\"wp-block-list\">\n<li>Login Method 1:\n<ul class=\"wp-block-list\">\n<li>go to https:\/\/[your sp site]\/saml_login<\/li>\n\n\n\n<li>You should get redirected to the IdP&#8217;s Drupal Login page to get logged in<\/li>\n\n\n\n<li>Upon a successful login, you should automatically get redirected from the login page, back to the SP as an authenticated user.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Login Method 2\n<ul class=\"wp-block-list\">\n<li>go to https:\/\/[your sp site]\/user\/login<\/li>\n\n\n\n<li>In the login form, you should now see an additional link that will take you to your IdP to login. If you followed the instructions above, the link should say &#8220;Login with Single Sign-On Login&#8221;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>If you&#8217;ve successfully logged in, you&#8217;ve setup SAML correctly. At this point, I replace Drupal&#8217;s link to \/user\/login with a link that goes to \/saml_login so that everyone gets to the right place automatically.<\/li>\n\n\n\n<li>Once you follow the Role Management tutorial below (3.4.1), log out of your SP and then log back in, now check your test user&#8217;s roles. They should have transferred over based on the rules you setup in the <strong>Automatic role population from simpleSAMLphp attributes<\/strong> field. You can now setup permissions for all the roles on this site to ensure users only have access to what they need.<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h4 class=\"wp-block-heading\"><a id=\"3461\" name=\"3461\">3.4.6.1. Mini tutorial for role management with Drupal and SimpleSAMLphp<\/a><\/h4>\n\n\n\n<p>If you remember in the SAML test page (or the attributes from the authsources.php file), you could see all the attributes that get sent to the SP from the IDP when you log in. These include fields like email and roles. We\u2019ll use these fields to assign people roles in the new system automatically when they get here from the IdP.<\/p>\n\n\n\n<p>Here\u2019s how the field works, we\u2019re going to setup a bunch of rules and the system will compare every user\u2019s SAML info on the way in and instantly assign them the right matching roles for us. It\u2019s incredibly brilliant.<\/p>\n\n\n\n<p><strong>How to create a rule:<\/strong><br><strong>Example:<\/strong> <code>sp_role:roles,=,idp_role|<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>sp_role<\/code> \u2013 this is the role here in the SP that you want to assign someone when they meet the criteria for this rule<\/li>\n\n\n\n<li><code>:roles,=,<\/code> \u2013 this is the programming\/math bit of the rule. It\u2019s saying the thing we defined before the colon is a role. In order to assign the role, it has to exactly match (=) the following in the user\u2019s Role SAML attribute.<\/li>\n\n\n\n<li><code>idp_role<\/code> \u2013 this is the machine name of the role that is coming from the IdP in the User\u2019s SAML attributes.<\/li>\n\n\n\n<li><code>|<\/code> \u2013 the pipe at the end separates this rule from the next one. Note that the final rule in this field should NOT have a pipe character.<\/li>\n<\/ul>\n\n\n\n<p><strong>So, a set of role assignments will look like this<\/strong>: <code>info_center_staff:roles,=,info_center_staff|nic_advisory_board:roles,=,advisory_board|nic_staff:roles,=,nic_basic_staff<\/code><\/p>\n\n\n\n<p><strong>Best practices, learned from experience<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Consider making all your SP\u2019s roles have sp_ at the beginning of them in the machine name. This makes reading this block of rules a little easier and helps you know which Role is which in the equation when you\u2019re sight-reading it.<\/li>\n\n\n\n<li>Match the names all your roles. It\u2019s so much easier when you know you\u2019re matching the SP role to the correct IdP role. Matching role names is the best way to do this.<\/li>\n\n\n\n<li>SAML ignores any rules that don\u2019t apply, so you can leave yourself a rule key (see the example at the top) at the beginning of your rules to help yourself out in the future if you add roles to the site.<\/li>\n\n\n\n<li>When you want users on your SP to have a new role, remember that you\u2019ll also need to create that role in the IdP. All user role management needs to be done in the IDP because the SP reevaluates user roles every time a user logs into the SP. We also don\u2019t want to have to manage users in multiple places. If we know everyone is managed on the main website, then that\u2019s an easy place to know we\u2019re getting it right every time.<\/li>\n<\/ul>\n\n\n\n<p><strong>Example 2: Assign roles based on email address<\/strong><\/p>\n\n\n\n<p>I set this up when we first started using SAML. These days, I prefer to just do everything with Roles, but I\u2019m showing this to you incase you need it.<\/p>\n\n\n\n<p>This worked better when our <em>small<\/em> staff all had @domain.com email addresses, it works less well, when your organization is huge, and everyone has the same email address. That said, if your organization needs its own role, this can work great.<br><code>administrators:mail,@=,domain.com|administrator_developers:mail,=,rex@<code>domain.com<\/code>|<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In the first rule, we\u2019re assigning the role of administrators to anyone with an email address that ends in(@=) nicic.gov<\/li>\n\n\n\n<li>In the second rule, we\u2019re assigning the role of administrator_developers to the person whose email (:mail,=,) matches rex@domain.com<\/li>\n<\/ul>\n\n\n\n<p><strong>Best practices, learned from experience<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This email method is nice for a person or two, but you don\u2019t want to be managing hundreds of users with individual email addresses.<\/li>\n\n\n\n<li>The other problem is that if rex@domain.com is fired or quits, you have to remember that you put in this bit of code and take it out!\n<ul class=\"wp-block-list\">\n<li>Aside from the obvious, if we delete Rex\u2019s account and he makes a new one, with the same email, it won\u2019t have the same roles, but this SAML rule ignores the roles on his account and has just assigned him as a full-fledged administrator!<\/li>\n\n\n\n<li>If we keep his original account, but remove his administrator rights at the IdP, the same thing happens \u2013 when he comes to the SP, he\u2019ll be granted full Admin rights!<\/li>\n\n\n\n<li><strong>An unhappy un-privileged person can cause a lot of damage. Since all permissions are managed by roles in Drupal, we suggest only using rules from Example 1<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"4\" name=\"4\">4. Follow up Actions<\/a><\/h2>\n\n\n\n<p>Your SAML setup should be used by staff and users daily. Make sure your staff know how to identify a SAML issue (usually problems getting redirected to the IdP or SP during login\/logout) and report it to you.<\/p>\n\n\n\n<p><strong>User\/Role: Web Developer<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Action: <\/strong>Set reminders to rotate certificates on a regular basis, in compliance with security best practices.<\/li>\n\n\n\n<li><strong>Action: <\/strong>Keep an eye on SimpleSAMLphp development as well as the modules for Drupal. SAML often becomes a key service in your infrastructure, and you want to know about any vulnerabilities or problems others are facing.<\/li>\n<\/ul>\n\n\n\n<p><strong>User\/Role: Program Manager<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Action: <\/strong>Take note of when certificates expire and remind web developers to rotate the certificates.<\/li>\n<\/ul>\n\n\n\n<p><strong>User\/Role: Other Staff<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Action: <\/strong>Learn about how to identify a SAML problem and report it to Web Developers<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"5\" name=\"5\">5. Resources<\/a><\/h2>\n\n\n\n<p>This section is for anything that didn\u2019t fit into the previous sections.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"51\" name=\"51\">5.1. Related or Useful Resources<\/a><\/h3>\n\n\n\n<p><strong>I am not promoting or representing the following recommendations, I have no ties to these recommendations, other than that I have found them helpful in the past and, at that time, had good experiences with them. I cannot vouch for your experience with them or how they may have changed since I interacted with them.<\/strong><\/p>\n\n\n\n<p><strong>Chrome Extensions:<\/strong><br>These are useful to people who need to troubleshoot SAML. As of 2023, I\u2019m finding the SAML errors to be pretty descriptive and I\u2019m able to troubleshoot without these extensions, but I want to mention them here just in case. Most of them work by having you attempt a SAML authentication and then looking at the SAML tokens that are sent between the IDP and SP. Typically, you&#8217;re looking for some piece of data that is pointing to the wrong place or another setting that&#8217;s misconfigured.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SAML Chrome Panel<\/li>\n\n\n\n<li>SAML Message Decoder<\/li>\n\n\n\n<li>SAML Dev Tools Extension<\/li>\n\n\n\n<li>And others&#8230;<\/li>\n<\/ul>\n\n\n\n<p><strong>Other useful guides<\/strong><\/p>\n\n\n\n<p>These are some other useful guides that best helped me understand how to setup SimpleSAMLphp with Drupal. They\u2019re a little outdated now, but I\u2019m sure they can add some extra perspective.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Installing SimpleSAMLphp:<br><a href=\"https:\/\/www.hashbangcode.com\/article\/installing-simplesamlphp-using-composer\">https:\/\/www.hashbangcode.com\/article\/installing-simplesamlphp-using-composer<\/a><\/li>\n\n\n\n<li>Setting up an SP:<br><a href=\"https:\/\/www.hashbangcode.com\/article\/drupal-9-configuring-drupal-authenticate-against-remote-simplesamlphp-identity-provider\">https:\/\/www.hashbangcode.com\/article\/drupal-9-configuring-drupal-authenticate-against-remote-simplesamlphp-identity-provider<\/a><\/li>\n\n\n\n<li>Setting up an IdP:<br><a href=\"https:\/\/www.hashbangcode.com\/article\/drupal-9-configuring-drupal-be-identity-provider-simplesamlphp\">https:\/\/www.hashbangcode.com\/article\/drupal-9-configuring-drupal-be-identity-provider-simplesamlphp<\/a><\/li>\n<\/ul>\n\n\n\n<p><strong>Useful SAML Assistance<\/strong><\/p>\n\n\n\n<p>In the past, I needed SAML help and hired <a href=\"https:\/\/idmengineering.com\/saml-support\">https:\/\/idmengineering.com\/saml-support<\/a> to help us resolve SAML connection issues we were facing and didn\u2019t have a grasp of SAML enough to understand. They were hired with the approval of my then manager and other stakeholders. If the above guide and settings in the files don\u2019t resolve your issue, this company may be able to help. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"52\" name=\"52\">5.2. Troubleshooting SAML<\/a><\/h3>\n\n\n\n<p>There is no super-easy way to instantly fix SAML issues. I will try to keep this section updated with problems I run into, but no promises. I recommend you keep your own log of errors you run into and how you solved them.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"521\" name=\"521\">5.2.1. SimpleSAMLphp 500 error<\/a><\/h4>\n\n\n\n<p>When upgrading from version 1.9 to 2.1, I encountered a 500 error on the front page of SimpleSAMLphp. This was resolved by updating the config.php file. There were some changes between the versions that fixed the issue once resolved. <\/p>\n\n\n\n<p>From this, I learned that the config.php file can be picky. Figure out a working version and then test with baby steps if you&#8217;re doing something that&#8217;s breaking the setup.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"522\" name=\"522\">5.2.2. Can\u2019t login to SimpleSAMLphp (page not found)<\/a><\/h4>\n\n\n\n<p>The login for SimpleSAMLphp itself is defined in the config.php file, so if you need to reset the admin password, do it there. In between maintenance, I turn off the Admin module in the config.php file to reduce the opportunity for attackers to break into SimpleSAMLphp. If you go to <code>https:\/\/[your site]\/idp\/admin<\/code> or <code>https:\/\/[your site]\/simplesaml\/admin<\/code> and it gives you an error, try enabling the admin module in the config file.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"523\" name=\"523\">5.2.3. Trouble logging in\/out and getting redirected to the SP or IdP<\/a><\/h4>\n\n\n\n<p>This might be a metadata problem. Make sure your IdP has your SP\u2019s metadata and the SP has the IdP\u2019s metadata. SimpleSAMLphp 2.1 is much better with descriptive errors than version 1.9.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"6\" name=\"6\">6. Appendices<\/a><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"61\" name=\"61\">6.1. Apache .conf file example snippet (IdP &amp; SP)<\/a><\/h3>\n\n\n\n<p>The following code goes in the virtualhost settings at the bottom. Since our sites only resolve on HTTPS connections, we only put these settings in that section, and it seems to work pretty well.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code># ****************************************<br># SIMPLSSAMLPHP 2.1 SETTINGS<br># **************************************** <br># ENVIRONMENT VARIABLES<br># Point the config directory to a custom directory that won\u2019t get overridden by composer updates<\/code><br><code>SetEnv SIMPLESAMLPHP_CONFIG DIR \/var\/www\/html\/<strong>[site root]<\/strong>\/simplesamlphp\/dev\/config <\/code><br><br><code># Set an alias to the IdP SimpleSAML directory<br># In some systems this is setup as a symlink, but I prefer this method.<\/code><br><code>Alias \/idp \/var\/www\/html\/<strong>[site root]<\/strong>\/vendor\/simplesamlphp\/ simplesamlphp\/public<\/code><br><code># OR for SP: <\/code><br><code># Alias \/simplesaml \/var\/www\/html\/<strong>[site root]<\/strong>\/vendor\/simplesamlphp\/simplesamlphp\/public \u00a0 <\/code><br><br><code># Set Access Rights <\/code><br><code>&lt;Directory \/var\/www\/html\/<strong>[site root]<\/strong>\/vendor\/simplesamlphp\/simplesamlphp\/public><br>\u00a0\u00a0\u00a0 &lt;IfModule mod_authz_core.c><br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # For Apache 2.4<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Require all granted<br>\u00a0\u00a0\u00a0 &lt;\/IfModule><br>&lt;\/Directory><\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"62\" name=\"62\">6.2. The IdP &amp; SP config.php file<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code>&lt;?php \/\/IdP config file 2023 <br>\/\/ The configuration of SimpleSAMLphp NEW 2022 <br><br>$httpUtils = new \\SimpleSAML\\Utils\\HTTP();<br>$config = [ <br> &nbsp;&nbsp;&nbsp; \/*******************************<br>&nbsp;&nbsp;&nbsp;&nbsp; | BASIC CONFIGURATION OPTIONS |<br>&nbsp;&nbsp;&nbsp;&nbsp; *******************************\/<br>&nbsp;&nbsp;&nbsp; 'baseurlpath' =&gt; '\/idp\/',<br>&nbsp;&nbsp;&nbsp; 'application' =&gt; [],<br>&nbsp;&nbsp;&nbsp; 'loggingdir' =&gt; '\/var\/www\/html\/<strong>[site root]<\/strong>\/simplesamlphp\/dev\/log\/',<br>&nbsp;&nbsp;&nbsp; 'datadir' =&gt; '\/var\/www\/html\/<code><strong>[site root]<\/strong><\/code>\/simplesamlphp\/dev\/data\/',<br>&nbsp;&nbsp;&nbsp; 'tempdir' =&gt; '\/var\/www\/html\/<code><strong>[site root]<\/strong><\/code>\/simplesamlphp\/dev\/tmp\/simplesaml',<br>&nbsp;&nbsp;&nbsp; 'certdir' =&gt; '\/var\/www\/html\/<code><strong>[site root]<\/strong><\/code>\/simplesamlphp\/dev\/certs\/',<br>&nbsp;&nbsp;&nbsp; 'technicalcontact_name' =&gt; '<strong>Web Administrator<\/strong>',<br>&nbsp;&nbsp;&nbsp; 'technicalcontact_email' =&gt; '<strong>saml@domain.com<\/strong>',<br>&nbsp;&nbsp;&nbsp; 'sendmail_from' =&gt; '<strong>admin@domain.com<\/strong>',<br>&nbsp;&nbsp;&nbsp; 'timezone' =&gt; '<strong>America\/Denver<\/strong>', <br><br> &nbsp;&nbsp;&nbsp; \/**********************************<br>&nbsp;&nbsp;&nbsp;&nbsp; | SECURITY CONFIGURATION OPTIONS |<br>&nbsp;&nbsp;&nbsp;&nbsp; **********************************\/<br>&nbsp;&nbsp;&nbsp; 'secretsalt' =&gt; '<strong>[your salt string]<\/strong>',<br>&nbsp;&nbsp;&nbsp; 'auth.adminpassword' =&gt; '<strong>[your secure password]<\/strong>',<br>&nbsp;&nbsp;&nbsp; 'admin.protectmetadata' =&gt; false,<br>&nbsp;&nbsp;&nbsp; 'admin.checkforupdates' =&gt; true,<br>&nbsp;&nbsp;&nbsp; 'trusted.url.domains' =&gt; ['<strong>yourdomain.com<\/strong>','<strong>subdomain.yourdomain.com<\/strong>'],<br>&nbsp;&nbsp;&nbsp; 'trusted.url.regex' =&gt; false,<br>&nbsp;&nbsp;&nbsp; 'enable.http_post' =&gt; false,<br>&nbsp;&nbsp;&nbsp; 'assertion.allowed_clock_skew' =&gt; 180, <br><br> &nbsp;&nbsp;&nbsp; \/************************<br>&nbsp;&nbsp;&nbsp;&nbsp; | ERRORS AND DEBUGGING |<br>&nbsp;&nbsp;&nbsp;&nbsp; ************************\/<br> &nbsp;&nbsp;&nbsp; 'debug' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'saml' =&gt; false,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'backtraces' =&gt; true,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'validatexml' =&gt; false,<br>&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; 'showerrors' =&gt; true,<br>&nbsp;&nbsp;&nbsp; 'errorreporting' =&gt; true,<br><br> &nbsp;&nbsp;&nbsp; \/**************************<br>&nbsp;&nbsp;&nbsp;&nbsp; | LOGGING AND STATISTICS |<br>&nbsp;&nbsp;&nbsp;&nbsp; **************************\/<br>&nbsp;&nbsp;&nbsp; 'logging.level' =&gt; SimpleSAML\\Logger::NOTICE,<br>&nbsp;&nbsp;&nbsp; 'logging.handler' =&gt; 'file',<br>&nbsp;&nbsp;&nbsp; 'logging.facility' =&gt; defined('LOG_LOCAL5') ? constant('LOG_LOCAL5') : LOG_USER,<br>&nbsp;&nbsp;&nbsp; 'logging.processname' =&gt; '<strong>simplesamlphp<\/strong>', \/\/must be unique per-site<br>&nbsp;&nbsp;&nbsp; 'logging.logfile' =&gt; 'simplesamlphp.log',<br>&nbsp;&nbsp;&nbsp; 'statistics.out' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/*[<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'class' =&gt; 'core:File',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'directory' =&gt; '\/var\/log\/stats',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],*\/<br>&nbsp;&nbsp;&nbsp; ],<br> <br>&nbsp;&nbsp;&nbsp; \/***********************<br>&nbsp;&nbsp;&nbsp;&nbsp; | PROXY CONFIGURATION |<br>&nbsp;&nbsp;&nbsp;&nbsp; ***********************\/<br>&nbsp;&nbsp;&nbsp;&nbsp; 'proxy' =&gt; null,<br><br>&nbsp;&nbsp;&nbsp; \/**************************<br>&nbsp;&nbsp;&nbsp;&nbsp; | DATABASE CONFIGURATION |<br>&nbsp;&nbsp;&nbsp;&nbsp; **************************\/<br> &nbsp;&nbsp;&nbsp;'database.dsn' =&gt; 'mysql:host=localhost;dbname=saml',<br>&nbsp;&nbsp;&nbsp; 'database.username' =&gt; 'simplesamlphp',<br>&nbsp;&nbsp;&nbsp; 'database.password' =&gt; 'secret',<br>&nbsp;&nbsp;&nbsp; 'database.options' =&gt; [],<br>&nbsp;&nbsp;&nbsp; 'database.prefix' =&gt; '',<br>&nbsp;&nbsp;&nbsp; 'database.driver_options' =&gt; [],<br>&nbsp;&nbsp;&nbsp; 'database.persistent' =&gt; false,<br>&nbsp;&nbsp;&nbsp; 'database.secondaries' =&gt; [],<br><br> &nbsp;&nbsp;&nbsp; \/*************<br>&nbsp;&nbsp;&nbsp;&nbsp; | PROTOCOLS |<br>&nbsp;&nbsp;&nbsp;&nbsp; *************\/<br>&nbsp;&nbsp;&nbsp; 'enable.saml20-idp' =&gt; true,<br>&nbsp;&nbsp;&nbsp; 'enable.adfs-idp' =&gt; false, <br><br> &nbsp;&nbsp;&nbsp; \/***********<br>&nbsp;&nbsp;&nbsp;&nbsp; | MODULES |<br>&nbsp;&nbsp;&nbsp;&nbsp; ***********\/<\/code><br><code> &nbsp;&nbsp;&nbsp;&nbsp; 'module.enable' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'exampleauth' =&gt; false,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'core' =&gt; true,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'saml' =&gt; true,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'admin' =&gt; <strong>false<\/strong>, \/\/ Prevent SAML Admin login just in case. Enable to get access to SAML admin<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'cron' =&gt; true,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'drupalauth' =&gt; true<br>&nbsp;&nbsp;&nbsp;&nbsp; ], <br><br> &nbsp;&nbsp;&nbsp; \/*************************<br>&nbsp;&nbsp;&nbsp;&nbsp; | SESSION CONFIGURATION |<br>&nbsp;&nbsp;&nbsp;&nbsp; *************************\/<br>&nbsp;&nbsp;&nbsp; 'session.duration' =&gt; 8 * (60 * 60), \/\/ 8 hours.<br>&nbsp;&nbsp;&nbsp; 'session.datastore.timeout' =&gt; (4 * 60 * 60), \/\/ 4 hours<br>&nbsp;&nbsp;&nbsp; 'session.state.timeout' =&gt; (60 * 60), \/\/ 1 hour<br>&nbsp;&nbsp;&nbsp; 'session.cookie.name' =&gt; '<strong>SessionID<\/strong>', \/\/must be unique per-site<br>&nbsp;&nbsp;&nbsp; 'session.cookie.lifetime' =&gt; 0,<br>&nbsp;&nbsp;&nbsp; 'session.cookie.path' =&gt; '\/',<br>&nbsp;&nbsp;&nbsp; 'session.cookie.domain' =&gt; '',<br>&nbsp;&nbsp;&nbsp; 'session.cookie.secure' =&gt; true,<br>&nbsp;&nbsp;&nbsp; 'session.cookie.samesite' =&gt; $httpUtils-&gt;canSetSameSiteNone() ? 'None' : null,<br>&nbsp;&nbsp;&nbsp; 'session.phpsession.cookiename' =&gt; '<strong>SimpleSAML<\/strong>', \/\/must be unique per-site<br>&nbsp;&nbsp;&nbsp; 'session.phpsession.savepath' =&gt; null,<br>&nbsp;&nbsp;&nbsp; 'session.phpsession.httponly' =&gt; true,<br>&nbsp;&nbsp;&nbsp; 'session.authtoken.cookiename' =&gt; '<strong>SimpleSAMLAuthToken<\/strong>', \/\/must be unique per-site<br>&nbsp;&nbsp;&nbsp; 'session.rememberme.enable' =&gt; false,<br>&nbsp;&nbsp;&nbsp; 'session.rememberme.checked' =&gt; false,<br>&nbsp;&nbsp;&nbsp; 'session.rememberme.lifetime' =&gt; (14 * 86400),<br><br> &nbsp;&nbsp;&nbsp; \/**************************<br>&nbsp;&nbsp;&nbsp;&nbsp; | MEMCACHE CONFIGURATION |<br>&nbsp;&nbsp;&nbsp;&nbsp; **************************\/<br>&nbsp;&nbsp;&nbsp; 'memcache_store.servers' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ['hostname' =&gt; 'localhost'],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; 'memcache_store.prefix' =&gt; '<strong>simpleSAMLphp<\/strong>', \/\/must be unique per-site<br>&nbsp;&nbsp;&nbsp; 'memcache_store.expires' =&gt; 36 * (60 * 60), \/\/36 hours. &nbsp; &nbsp;&nbsp;&nbsp;       <br><br>     \/*************************************<br>&nbsp;&nbsp;&nbsp;&nbsp; | LANGUAGE AND INTERNATIONALIZATION |<br>&nbsp;&nbsp;&nbsp;&nbsp; *************************************\/<br>&nbsp;&nbsp;&nbsp; 'language.available' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'en', 'no', 'nn', 'se', 'da', 'de', 'sv', 'fi', 'es', 'ca', 'fr', 'it', 'nl', 'lb',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'cs', 'sk', 'sl', 'lt', 'hr', 'hu', 'pl', 'pt', 'pt-br', 'tr', 'ja', 'zh', 'zh-tw',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'ru', 'et', 'he', 'id', 'sr', 'lv', 'ro', 'eu', 'el', 'af', 'zu', 'xh', 'st',<br>&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; 'language.rtl' =&gt; ['ar', 'dv', 'fa', 'ur', 'he'],<br>&nbsp;&nbsp;&nbsp; 'language.default' =&gt; 'en',<br>&nbsp;&nbsp;&nbsp; 'language.parameter.name' =&gt; 'language',<br>&nbsp;&nbsp;&nbsp; 'language.parameter.setcookie' =&gt; true,<br>&nbsp;&nbsp;&nbsp; 'language.cookie.name' =&gt; 'language',<br>&nbsp;&nbsp;&nbsp; 'language.cookie.domain' =&gt; '',<br>&nbsp;&nbsp;&nbsp; 'language.cookie.path' =&gt; '\/',<br>&nbsp;&nbsp;&nbsp; 'language.cookie.secure' =&gt; true,<br>&nbsp;&nbsp;&nbsp; 'language.cookie.httponly' =&gt; false,<br>&nbsp;&nbsp;&nbsp; 'language.cookie.lifetime' =&gt; (60 * 60 * 24 * 900),<br>&nbsp;&nbsp;&nbsp; 'language.cookie.samesite' =&gt; $httpUtils-&gt;canSetSameSiteNone() ? 'None' : null,<br><br> &nbsp;&nbsp;&nbsp; \/**************<br>&nbsp;&nbsp;&nbsp;&nbsp; | APPEARANCE |<br>&nbsp;&nbsp;&nbsp;&nbsp; **************\/<br>&nbsp;&nbsp;&nbsp; 'theme.use' =&gt; 'default',<br>&nbsp;&nbsp;&nbsp; 'template.auto_reload' =&gt; false,<br>&nbsp;&nbsp;&nbsp; 'production' =&gt; true,<br>&nbsp;&nbsp;&nbsp; 'assets' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'caching' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'max_age' =&gt; 86400,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'etag' =&gt; false,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; ],<br><br> &nbsp;&nbsp;&nbsp; \/*********************<br>&nbsp;&nbsp;&nbsp;&nbsp; | DISCOVERY SERVICE |<br>&nbsp;&nbsp;&nbsp;&nbsp; *********************\/<br>&nbsp;&nbsp;&nbsp; 'idpdisco.enableremember' =&gt; true,<br>&nbsp;&nbsp;&nbsp; 'idpdisco.rememberchecked' =&gt; true,<br>&nbsp;&nbsp;&nbsp; 'idpdisco.validate' =&gt; true,<br>&nbsp;&nbsp;&nbsp; 'idpdisco.extDiscoveryStorage' =&gt; null,<br>&nbsp;&nbsp;&nbsp; 'idpdisco.layout' =&gt; 'dropdown', <br><br><br> &nbsp;&nbsp;&nbsp; \/*************************************<br>&nbsp;&nbsp;&nbsp;&nbsp; | AUTHENTICATION PROCESSING FILTERS |<br>&nbsp;&nbsp;&nbsp;&nbsp; *************************************\/<br> &nbsp;&nbsp;&nbsp; 'authproc.idp' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 30 =&gt; 'core:LanguageAdaptor',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 45 =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'class'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'core:StatisticsWithAttribute',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'attributename' =&gt; 'realm',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'type'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'saml20-idp-SSO',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 50 =&gt; 'core:AttributeLimit',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 99 =&gt; 'core:LanguageAdaptor',<br>&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; 'authproc.sp' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 90 =&gt; 'core:LanguageAdaptor',<br>&nbsp;&nbsp;&nbsp; ],<br><br> &nbsp;&nbsp;&nbsp; \/**************************<br>&nbsp;&nbsp;&nbsp;&nbsp; | METADATA CONFIGURATION |<br>&nbsp;&nbsp;&nbsp;&nbsp; **************************\/<br>&nbsp;&nbsp;&nbsp; 'metadatadir' =&gt; 'metadata',<br>&nbsp;&nbsp;&nbsp; 'metadata.sources' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'type' =&gt; 'flatfile',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'directory' =&gt; '\/var\/www\/html\/<strong>[site root]<\/strong>\/simplesamlphp\/dev\/metadata\/',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; 'metadata.sign.enable' =&gt; false,<br>&nbsp;&nbsp;&nbsp; 'metadata.sign.privatekey' =&gt; null,<br>&nbsp;&nbsp;&nbsp; 'metadata.sign.privatekey_pass' =&gt; null,<br>&nbsp;&nbsp;&nbsp; 'metadata.sign.certificate' =&gt; null,<br>&nbsp;&nbsp;&nbsp; 'metadata.sign.algorithm' =&gt; 'http:\/\/www.w3.org\/2001\/04\/xmldsig-more#rsa-sha256', &nbsp; &nbsp;&nbsp;&nbsp; <br><br>    \/****************************<br>&nbsp;&nbsp;&nbsp;&nbsp; | DATA STORE CONFIGURATION |<br>&nbsp;&nbsp;&nbsp;&nbsp; ****************************\/<br>&nbsp;&nbsp;&nbsp; 'store.type'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'sql',<br>&nbsp;&nbsp;&nbsp; 'store.sql.dsn'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'mysql:host=localhost;dbname=<strong>[your sql database]<\/strong>,<br>&nbsp;&nbsp;&nbsp; 'store.sql.username' =&gt; '<strong>[your sql username]<\/strong>',<br>&nbsp;&nbsp;&nbsp; 'store.sql.password' =&gt; '<strong>[your sql user password]<\/strong>',<br>&nbsp;&nbsp;&nbsp; 'store.sql.prefix'&nbsp;&nbsp; =&gt; '<strong>SAML<\/strong>', \/\/must be unique per-site<br>&nbsp;&nbsp;&nbsp; 'store.sql.options' =&gt; [],<br>&nbsp;&nbsp;&nbsp; 'store.redis.host' =&gt; 'localhost',<br>&nbsp;&nbsp;&nbsp; 'store.redis.port' =&gt; 6379,<br>&nbsp;&nbsp;&nbsp; 'store.redis.username' =&gt; '',<br>&nbsp;&nbsp;&nbsp; 'store.redis.password' =&gt; '',<br>&nbsp;&nbsp;&nbsp; 'store.redis.tls' =&gt; false,<br>&nbsp;&nbsp;&nbsp; 'store.redis.insecure' =&gt; false,<br>&nbsp;&nbsp;&nbsp; 'store.redis.ca_certificate' =&gt; null,<br>&nbsp;&nbsp;&nbsp; 'store.redis.certificate' =&gt; null,<br>&nbsp;&nbsp;&nbsp; 'store.redis.privatekey' =&gt; null,<br>&nbsp;&nbsp;&nbsp; 'store.redis.prefix' =&gt; '<strong>SimpleSAMLphp<\/strong>', \/\/must be unique per-site<br>&nbsp;&nbsp;&nbsp; 'store.redis.mastergroup' =&gt; 'mymaster',<br>&nbsp;&nbsp;&nbsp; 'store.redis.sentinels' =&gt; [],<br>&nbsp;&nbsp;&nbsp; 'proxymode.passAuthnContextClassRef' =&gt; false,<br>];<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"63\" name=\"63\">6.3. The IdP authsources.php file<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code>&lt;?php<br>$config = [<br>&nbsp;&nbsp; \u2018admin\u2019 =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2018core:AdminPassword\u2019,<br>&nbsp;&nbsp; ],<br> &nbsp; \u2018drupal-userpass\u2019 =&gt; array(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2018drupalauth:External\u2019,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2018drupalroot\u2019 =&gt; \u2018\/var\/www\/html\/<strong>[site root]<\/strong>\/web\u2019,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2018debug\u2019 =&gt; true,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2018drupal_logout_url\u2019 =&gt; \u2018https:\/\/<strong>[your site]<\/strong>\/user\/logout\u2019,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u2018drupal_login_url\u2019 =&gt; \u2018https:\/\/<strong>[your site]<\/strong>\/user\/login\u2019,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'attributes' =&gt; array(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'uid', 'attribute_name' =&gt; 'uid'), \/\/UID<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'name', 'attribute_name' =&gt; 'cn'), \/\/Username<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'mail', 'attribute_name' =&gt; 'mail'), \/\/email<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'roles', 'attribute_name' =&gt; 'roles', 'field_property' =&gt; 'target_id'), \/\/Roles &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br>       array('field_name' =&gt; 'uuid', 'attribute_name' =&gt; 'uuid'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'status', 'attribute_name' =&gt; 'status'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_first_name', 'attribute_name' =&gt; 'givenName'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_last_name', 'attribute_name' =&gt; 'sn'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_organization', 'attribute_name' =&gt; 'ou', 'field_property' =&gt; 'target_id'), <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>\/\/ OPTIONAL other examples of custom fields<\/strong><\/code><br>              <strong>\/\/ these can be removed if you don&#8217;t need them<\/strong><br>              <strong>\/\/ Key: <code>array('field_name' =&gt; 'drupal_field_name', 'attribute_name' =&gt; 'target_field_name_sp_needs'),<\/code><\/strong><code><strong><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'status', 'attribute_name' =&gt; 'STATUS'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'uid', 'attribute_name' =&gt; 'USERID'), \/\/UID<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'name', 'attribute_name' =&gt; 'USERNAME'), \/\/Username<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_first_name', 'attribute_name' =&gt; 'FIRSTNAME'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_last_name', 'attribute_name' =&gt; 'LASTNAME'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_job_title', 'attribute_name' =&gt; 'TITLE'), &nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_manager', 'attribute_name' =&gt; 'MANAGER'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_hr', 'attribute_name' =&gt; 'HR'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_department', 'attribute_name' =&gt; 'DEPARTMENT'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_division', 'attribute_name' =&gt; 'DIVISION'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'timezone', 'attribute_name' =&gt; 'TIMEZONE'),<\/strong><br> &nbsp;&nbsp;&nbsp;&nbsp; ),<br> &nbsp; ),<br> &nbsp; 'ssp-userpass' =&gt; array(<br>&nbsp;&nbsp;&nbsp;&nbsp; 'drupalauth:UserPass',<br>&nbsp;&nbsp;&nbsp;&nbsp; 'drupalroot' =&gt; '\/var\/www\/html\/<strong>[site root]<\/strong>\/web',<br>&nbsp;&nbsp;&nbsp;&nbsp; 'debug' =&gt; true,<br>&nbsp;&nbsp;&nbsp;&nbsp; 'attributes' =&gt; array(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'uid', 'attribute_name' =&gt; 'uid'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'roles', 'attribute_name' =&gt; 'roles', 'field_property' =&gt; 'target_id'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'name', 'attribute_name' =&gt; 'cn'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'mail', 'attribute_name' =&gt; 'mail'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_first_name', 'attribute_name' =&gt; 'givenName'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_last_name', 'attribute_name' =&gt; 'sn'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array('field_name' =&gt; 'field_organization', 'attribute_name' =&gt; 'ou', 'field_property' =&gt; 'target_id'),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br>&nbsp; ),<br>];<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"64\" name=\"64\">6.4. The IdP metadata saml20-idp-hosted.php file<\/a><\/h3>\n\n\n\n<p>This file identifies the certificates and authsource that will be used for the IdP.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code>&lt;?php<br>$metadata['<strong>IDP ENTITYID<\/strong>'] = [<br>&nbsp; &nbsp; 'host' =&gt; '__DEFAULT__',<br>&nbsp; &nbsp; 'privatekey' =&gt; '<strong>idp-cert<\/strong>.pem',<br>&nbsp; &nbsp; 'certificate' =&gt; '<strong>idp-cert<\/strong>.crt',<br>&nbsp; &nbsp; \/\/NOTE: AUTHSOURCE IS SET HERE<br>&nbsp; &nbsp; 'auth' =&gt; '<strong>drupal-userpass<\/strong>',<br>];<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"65\" name=\"65\">6.5. IdP metadata saml20-sp-remote.php<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code>&lt;?php <br>\/* ================ <strong>SP site name \u2013 4\/2023<\/strong> =============== *\/ <br>$metadata['<strong>[sp entityID]<\/strong>'] = [<br>&nbsp;&nbsp;&nbsp; 'SingleLogoutService' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Binding' =&gt; 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Location' =&gt; 'https:\/\/<strong>[your sp site]<\/strong>\/simplesaml\/module.php\/saml\/sp\/saml2-logout.php\/default-sp',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Binding' =&gt; 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Location' =&gt; 'https:\/\/<strong>[your sp site]<\/strong>\/simplesaml\/module.php\/saml\/sp\/saml2-logout.php\/default-sp',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ], &nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; 'AssertionConsumerService' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Binding' =&gt; 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Location' =&gt; 'https:\/\/<strong>[your sp site]<\/strong>\/simplesaml\/module.php\/saml\/sp\/saml2-acs.php\/default-sp',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'index' =&gt; 0,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Binding' =&gt; 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Location' =&gt; 'https:\/\/<strong>[your sp site]<\/strong>\/simplesaml\/module.php\/saml\/sp\/saml2-acs.php\/default-sp',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'index' =&gt; 1,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; 'contacts' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'emailAddress' =&gt; '<strong>webmanager@domain.com<\/strong>',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'givenName' =&gt; '<strong>Web Administrator<\/strong>',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'contactType' =&gt; '<strong>technical<\/strong>',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; ],<br>];<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"66\" name=\"66\">6.6. The SP authsources.php file<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code>&lt;?php<br>$config = [<br>&nbsp; \u2018admin\u2019=&gt;[<br>&nbsp;&nbsp;&nbsp; core:AdminPassword\u2019,<br>&nbsp; ],<br>&nbsp; \u2018default-sp\u2019=&gt;[<br>&nbsp;&nbsp;&nbsp; \u2018saml:SP\u2019,<br>&nbsp;&nbsp;&nbsp; \u2018entityID\u2019=&gt; \u2018https:\/\/<strong>[your sp site]<\/strong>\/simplesaml\/\u2019,<br>&nbsp;&nbsp;&nbsp; \u2018idp\u2019=&gt;'<strong>[idp entity ID]<\/strong>\u2019,<br>&nbsp;&nbsp;&nbsp; \u2018discoURL\u2019=&gt;null,<br>&nbsp;&nbsp;&nbsp; \u2018proxymode.passAuthnContextClassRef\u2019=&gt; false,<br>&nbsp; ],<br>];<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"67\" name=\"67\">6.7. The SP metadata saml20-idp-remote.php<\/a><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code>$metadata['<strong>[your entity ID]<\/strong>'] = [<br>&nbsp;&nbsp;&nbsp; 'metadata-set' =&gt; 'saml20-idp-hosted',<br>&nbsp;&nbsp;&nbsp; 'entityid' =&gt; '<strong>[your entity ID]<\/strong>',<br>&nbsp;&nbsp;&nbsp; 'SingleSignOnService' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Binding' =&gt; 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Location' =&gt; 'https:\/\/<strong>[your site]<\/strong>\/idp\/module.php\/saml\/idp\/singleSignOnService',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; 'SingleLogoutService' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Binding' =&gt; 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Location' =&gt; 'https:\/\/<strong>[your site]<\/strong>\/idp\/module.php\/saml\/idp\/singleLogout',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; 'NameIDFormat' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient',<br>&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; 'contacts' =&gt; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'emailAddress' =&gt; '<strong>webmanager@domain.com<\/strong>',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'givenName' =&gt; '<strong>Web Administrator<\/strong>',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'contactType' =&gt; '<strong>technical<\/strong>',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; 'certData' =&gt; '<strong>[certificate data]<\/strong>',<br>];<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide (and its title) is so long because this is the level of detail and explanation I needed when I started learning about SAML and Drupal. It was hard to find anything that gave me the what and the why of how SAML worked and how I could successfully integrate it with my Drupal [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-236","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-json\/wp\/v2\/posts\/236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-json\/wp\/v2\/comments?post=236"}],"version-history":[{"count":8,"href":"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-json\/wp\/v2\/posts\/236\/revisions"}],"predecessor-version":[{"id":261,"href":"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-json\/wp\/v2\/posts\/236\/revisions\/261"}],"wp:attachment":[{"href":"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-json\/wp\/v2\/media?parent=236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-json\/wp\/v2\/categories?post=236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rexbarkdoll.com\/rexbarkdoll\/wp-json\/wp\/v2\/tags?post=236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}