diff --git a/config-templates/authsources.php b/config-templates/authsources.php index 1ff4df4918ba3fd29219816db93f2b792b9f1dc0..eca5eff6d4b8e1c846bec241b096ccca145088fb 100644 --- a/config-templates/authsources.php +++ b/config-templates/authsources.php @@ -16,6 +16,11 @@ $config = array( 'eduPersonAffiliation' => array('member', 'employee'), 'cn' => array('Test User'), ), + + // Requires you to enable the OpenID module. + 'openid' => array( + 'openid:OpenIDConsumer', + ), 'example-userpass' => array( 'exampleauth:UserPass', diff --git a/modules/openid/www/initopenid.php b/modules/openid/www/initopenid.php new file mode 100644 index 0000000000000000000000000000000000000000..9db74fa6082b10ba2f71fdbe7f5cd5c761dc76d1 --- /dev/null +++ b/modules/openid/www/initopenid.php @@ -0,0 +1,26 @@ +<?php + +/** + * The _include script registers a autoloader for the simpleSAMLphp libraries. It also + * initializes the simpleSAMLphp config class with the correct path. + */ +require_once('_include.php'); + + +/* Load simpleSAMLphp, configuration and metadata */ +$config = SimpleSAML_Configuration::getInstance(); +$session = SimpleSAML_Session::getInstance(); + +if (empty($_REQUEST['RelayState'])) { + SimpleSAML_Utilities::fatalError($session->getTrackID(), 'NORELAYSTATE'); +} + +if (! $session->isValid('openid') ) { + /* Authenticate with an AuthSource. */ + $hints = array(); + if (array_key_exists('openid', $_REQUEST)) $hints['openid'] = $_REQUEST['openid']; + SimpleSAML_Auth_Default::initLogin('openid', $_REQUEST['RelayState'], NULL, $hints); +} + + +?> \ No newline at end of file