Skip to content
Snippets Groups Projects
Commit de23de98 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

I've added SAML 2.0 IdP Discovery support for Shibboleth 1.3 SP. Off course...

I've added SAML 2.0 IdP Discovery support for Shibboleth 1.3 SP. Off course you can still use regular Shibboleth 1.3 WAYF if you want, just by configuring the WAYF as an IdP.


git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@49 44740490-163a-0410-bde0-09ae8108e29a
parent 2ee0f499
No related branches found
No related tags found
No related merge requests found
<?php
require_once('../../_include.php');
require_once('SimpleSAML/Utilities.php');
require_once('SimpleSAML/Session.php');
require_once('SimpleSAML/XHTML/Template.php');
require_once('SimpleSAML/XML/MetaDataStore.php');
session_start();
$config = SimpleSAML_Configuration::getInstance();
$metadata = new SimpleSAML_XML_MetaDataStore($config);
$session = SimpleSAML_Session::getInstance();
try {
if (!isset($_GET['entityID'])) throw new Exception('Missing parameter: entityID');
if (!isset($_GET['return'])) throw new Exception('Missing parameter: return');
if (!isset($_GET['returnIDParam'])) throw new Exception('Missing parameter: returnIDParam');
$spentityid = $_GET['entityID'];
$return = $_GET['return'];
$returnidparam = $_GET['returnIDParam'];
} catch (Exception $exception) {
$et = new SimpleSAML_XHTML_Template($config, 'error.php');
$et->data['message'] = 'Error getting required parameters for IdP Discovery Service';
$et->data['e'] = $exception;
$et->show();
exit(0);
}
if (isset($_GET['idpentityid'])) {
$idpentityid = $_GET['idpentityid'];
$returnurl = SimpleSAML_Utilities::addURLparameter($return, $returnidparam . '=' . $idpentityid);
header('Location: ' . $returnurl);
exit(0);
}
$idplist = $metadata->getList('shib13-idp-remote');
$t = new SimpleSAML_XHTML_Template($config, 'selectidp.php');
$t->data['header'] = 'Select your identity provider';
$t->data['idplist'] = $idplist;
$t->data['urlpattern'] = htmlentities(SimpleSAML_Utilities::selfURL() . '&idpentityid=');
$t->show();
?>
\ No newline at end of file
...@@ -45,6 +45,18 @@ try { ...@@ -45,6 +45,18 @@ try {
if (!isset($session) || !$session->isValid() ) { if (!isset($session) || !$session->isValid() ) {
if ($idpentityid == null) {
$returnURL = urlencode(SimpleSAML_Utilities::selfURL());
$discservice = '/' . $config->getValue('baseurlpath') . 'shib13/sp/idpdisco.php?entityID=' . $spentityid .
'&return=' . $returnURL . '&returnIDParam=idpentityid';
header('Location: ' . $discservice);
exit(0);
}
try { try {
$ar = new SimpleSAML_XML_Shib13_AuthnRequest($config, $metadata); $ar = new SimpleSAML_XML_Shib13_AuthnRequest($config, $metadata);
$ar->setIssuer($spentityid); $ar->setIssuer($spentityid);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment