Skip to content

Configuring Authentication using SimpleSAMLphp

Irina Zaks edited this page Feb 2, 2023 · 15 revisions

Based on article from Stanford Open Source Lab

Overview

The following files are used in configuration

  • authsources.php - shows location of your certificates and default IDP
  • saml20-idp-remote.php - contains metadata for your IDP provider
  • settings.php - defines path to simplesaml library ( $settings['simplesamlphp_dir'] = $_SERVER['HOME'] .'/code/private/simplesamlphp';) and redirect to primary custom domain
  • config.php - various configuration parameters

Setting SimpleSAMLphp library

Download SimpleSAMLphp from https://simplesamlphp.org/download Unzip into a directory and tell server where library is located Here is example of instructions for adding library in directory /private/simplesamlphp/www and setting symlink

Server SSL certificate and https connection

Make sure the web server has a valid SSL certificate and set up for https. Setting your SSL certificate cd into SimpleSAMLphp cert directory (on your local computer) and create a self-signed certificate: openssl req -newkey rsa:2048 -new -x509 -days 3652 -nodes -out saml.crt -keyout saml.pem

cd into SimpleSAMLphp/config directory and edit authsources.php In the "default-sp" section, change

`"idp" => null,
to: "idp" => "https://idp.someurl.edu/',

and add the following: 'privatekey' => 'saml.pem', 'certificate' => 'saml.crt', 'authproc' => array( 20 => 'saml:NameIDAttribute', ),

Clone this wiki locally