Updating Valghalla and setting up SSO🔗

Updating Valghalla to latest tag.🔗

Instructions can be found here.

Installing SimpleSAMLPHP🔗

Download the latest available version from here:

wget -O /var/simplesamlphp.tar.gz https://simplesamlphp.org/download?latest

Extract the archive, delete it, and move into it:

cd /var
tar -zxvf simplesamlphp.tar.gz
rm simplesamlphp.tar.gz
cd simplesamlphp

config.php configuration:🔗

vim conig/config.php
  1. baseurlpath:
  1. technicalcontact_email:
  1. timezone:
  1. secretsalt:
  1. auth.adminpassword:
  1. logging.level:
  1. store.type:

Apache config🔗

   SetEnv SIMPLESAMLPHP_CONFIG_DIR /var/simplesamlphp/config
   Alias /simplesaml /var/simplesamlphp/www

   <Directory /var/simplesamlphp/www>
      <IfModule !mod_authz_core.c>
         # For Apache 2.2:
         Order allow,deny
         Allow from all
      </IfModule>
      <IfModule mod_authz_core.c>
         # For Apache 2.4:
         Require all granted
      </IfModule>
   </Directory>
   php_admin_value open_basedir /var/www/website.com:/usr/share/php:/var/simplesamlphp

Remember to change according to your site, then run this command:

systemctl restart apache2

Metadata🔗

We'll generate this in [url]/simplesaml/admin/metadata-converter.php

Check the metadata titles. The idp would usually be saml20-idp-remote and if you don't have a hosted SP, then that would be something like saml20-sp-remote. The files you're looking for are in metadata/, called saml20-idp-remote.php and saml20-sp-remote.php.

Paste the $metadata arrays into those files.

Authsources🔗

We need to define authentication sources now.

vim config/authsources.php

If we have a remote sp and idp, get the entity-id of the idp and paste it at 'idp' => null.

Example:

'idp' => 'https://serviceprovider.remote.com/thingie',

If we have our own sp, find the sp profile you created earlier and put the idp in (example above).

To find the entity-id of the SP, go here: [website]/simplesaml/module.php/core/frontpage_federation.php

and find your SP. That will the entity id to paste into your entity-id in your sp.

Example:

https://website.com/simplesaml/module.php/saml/sp/metadata.php/custom-sp

Drupal configuration🔗

First, we need to install and enable the simplesaml module:

drush en simplesamlphp_auth        # This might be wrong, maybe use composer?

Then go to [website]/admin/config/people/simplesamlphp_auth

  1. Check Activate authentication via SimpleSAMLphp
  2. Check Force https for login links
  3. Make sure Autenticaton source for this SP (default: default-sp) points to the right SP
  4. Which attribute from simpleSAMLphp should be used as user's name *
  1. Which attribute from simpleSAMLphp should be used as unique identifier for the user *:
  1. Which attribute from simpleSAMLphp should be used as user mail address:
  1. Check Register users (i.e., auto-provisioning) (under User Provisioning)

  2. Check Allow SAML users to set Drupal passwords. (under Drupal Authentication)

  3. Check Allow authentication with local Drupal accounts

  4. Which ROLES should be allowed to login with local accounts? Chose roles

  5. Which users should be allowed to login with local accounts?: 1

  6. Optionally, specify a URL for users to go to after logging out: Usually just the frontpage or login.

  7. Save settings

And you're done!