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

Implemented debug modus for HTTP-REDIRECT, and fixed logout page for example

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@18 44740490-163a-0410-bde0-09ae8108e29a
parent de90290c
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,50 @@ ...@@ -42,6 +42,50 @@
<para>Here is changes between simpleSAML versions. Look here if you are <para>Here is changes between simpleSAML versions. Look here if you are
upgrading, to see if there are any changes to the config format.</para> upgrading, to see if there are any changes to the config format.</para>
<section>
<title>Version 0.5</title>
<para>Released . Revision X.</para>
<itemizedlist>
<listitem>
<para>Metadata files have been more tidy. Removed unused entries.
Look at the new templates on how to change your existing
metadata.</para>
</listitem>
<listitem>
<para>Support for sending metadata on mail to Feide. Automatically
detecting if you have configured Feide as the default IdP.</para>
</listitem>
<listitem>
<para>Improved SAML 2.0 Metadata generation</para>
</listitem>
<listitem>
<para>Added support for Shibboleth 1.3 IdP functionality.</para>
</listitem>
<listitem>
<para>Added RADIUS authentication backend</para>
</listitem>
<listitem>
<para>Added support for HTTP-Redirect debugging when enable
<literal>debug=true</literal></para>
</listitem>
<listitem>
<para>SAML 2.0 SP example now contains a logout page.</para>
</listitem>
<listitem>
<para>Fixed some minor bugs.</para>
</listitem>
</itemizedlist>
</section>
<section> <section>
<title>Version 0.4</title> <title>Version 0.4</title>
...@@ -230,7 +274,7 @@ cp -r metadata-templates/*.php metadata/ ...@@ -230,7 +274,7 @@ cp -r metadata-templates/*.php metadata/
<para>There is one parameter debug that may be set to true or false. If <para>There is one parameter debug that may be set to true or false. If
you set it to true, then all Browser/POST SAML messages will be printed to you set it to true, then all Browser/POST SAML messages will be printed to
the web browser, and the user will have to manually submit it. </para> the web browser, and the user will have to manually submit it.</para>
<para>The session.duration parameter says how many seconds that a session <para>The session.duration parameter says how many seconds that a session
should be valid. After this amont of time, the session is not valid should be valid. After this amont of time, the session is not valid
...@@ -334,8 +378,8 @@ cp -r metadata-templates/*.php metadata/ ...@@ -334,8 +378,8 @@ cp -r metadata-templates/*.php metadata/
<title>Setting up a Shibboleth 1.3 SP</title> <title>Setting up a Shibboleth 1.3 SP</title>
<para>If you want to configure a service with authentication towards an <para>If you want to configure a service with authentication towards an
external Shibboleth 1.3 IdP, this section describes you how to proceed. external Shibboleth 1.3 IdP, this section describes you how to
</para> proceed.</para>
<section> <section>
<title>Configuring metadata for Shibboleth 1.3 SP</title> <title>Configuring metadata for Shibboleth 1.3 SP</title>
...@@ -542,8 +586,8 @@ openssl x509 -req -days 60 -in server2.csr -signkey server2.key -out server2.crt ...@@ -542,8 +586,8 @@ openssl x509 -req -days 60 -in server2.csr -signkey server2.key -out server2.crt
<section> <section>
<title>Authentication API</title> <title>Authentication API</title>
<para>The authentication plugin should be placed in the auth directory. <para>The authentication plugin should be placed in the auth
</para> directory.</para>
<para>The following parameters must be accepted in the incomming <para>The following parameters must be accepted in the incomming
URL:</para> URL:</para>
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
require_once('SimpleSAML/Configuration.php'); require_once('SimpleSAML/Configuration.php');
require_once('SimpleSAML/XML/MetaDataStore.php'); require_once('SimpleSAML/XML/MetaDataStore.php');
require_once('SimpleSAML/XML/SAML20/AuthnResponse.php'); require_once('SimpleSAML/XML/SAML20/AuthnResponse.php');
require_once('SimpleSAML/XHTML/Template.php');
/** /**
* Configuration of SimpleSAMLphp * Configuration of SimpleSAMLphp
*/ */
......
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
require_once('SimpleSAML/Configuration.php'); require_once('SimpleSAML/Configuration.php');
require_once('SimpleSAML/XML/MetaDataStore.php'); require_once('SimpleSAML/XML/MetaDataStore.php');
require_once('SimpleSAML/XHTML/Template.php');
/** /**
* Configuration of SimpleSAMLphp * Configuration of SimpleSAMLphp
*/ */
...@@ -46,8 +48,25 @@ class SimpleSAML_Bindings_SAML20_HTTPRedirect { ...@@ -46,8 +48,25 @@ class SimpleSAML_Bindings_SAML20_HTTPRedirect {
$redirectURL .= "&RelayState=" . urlencode($relayState); $redirectURL .= "&RelayState=" . urlencode($relayState);
} }
if ($this->configuration->getValue('debug')) {
$p = new SimpleSAML_XHTML_Template($this->configuration, 'httpredirect-debug.php');
$p->data['header'] = 'HTTP-REDIRECT Debug';
$p->data['url'] = $redirectURL;
$p->data['message'] = htmlentities($request);
$p->show();
} else {
header("Location: " . $redirectURL); header("Location: " . $redirectURL);
}
} }
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo $data['header']; ?></title>
<script>
<!--
function sf(){document.f.username.focus();}
// -->
</script>
<style type="text/css">
/* these styles are in the head of this page because this is a unique page */
/* THE BIG GUYS */
* {margin:0;padding:0}
body {text-align:center;padding: 20px 0;background: #222;color:#333;font:83%/1.5 arial,tahoma,verdana,sans-serif}
img {border:none;display:block}
hr {margin: 1em 0;background:#eee;height:1px;color:#eee;border:none;clear:both}
/* LINKS */
a,a:link,a:link,a:link,a:hover {font-weight:bold;background:transparent;text-decoration:underline;cursor:pointer}
a:link {color:#c00}
a:visited {color:#999}
a:hover,a:active {color:#069}
/* LISTS */
ul {margin: .3em 0 1.5em 2em}
ul.related {margin-top:-1em}
li {margin-left:2em}
dt {font-weight:bold}
#wrap {border: 1px solid #fff;position:relative;background:#fff;width:600px;margin: 0 auto;text-align:left}
#header {background: #666 url("/<?php echo $data['baseurlpath']; ?>resources/sprites.gif") repeat-x 0 100%;margin: 0 0 25px;padding: 0 0 8px}
#header h1 {color:#fff;font-size: 145%;padding:20px 20px 12px}
#poweredby {width:96px;height:63px;position:absolute;top:0;right:0}
#content {padding: 0 20px}
/* TYPOGRAPHY */
p, ul, ol {margin: 0 0 1.5em}
h1, h2, h3, h4, h5, h6 {letter-spacing: -1px;font-family: arial,verdana,sans-serif;margin: 1.2em 0 .3em;color:#000;border-bottom: 1px solid #eee;padding-bottom: .1em}
h1 {font-size: 196%;margin-top:0;border:none}
h2 {font-size: 136%}
h3 {font-size: 126%}
h4 {font-size: 116%}
h5 {font-size: 106%}
h6 {font-size: 96%}
.old {text-decoration:line-through}
</style>
</head>
<body onload="sf();">
<div id="wrap">
<div id="header">
<h1>simpleSAMLphp HTTP-REDIRECT debug</h1>
<div id="poweredby"><img src="/<?php echo $data['baseurlpath']; ?>resources/icons/debug.png" alt="Debug" /></div>
</div>
<div id="content">
<h2>Sending a SAML message using HTTP-REDIRECT</h2>
<p>You are about to send a SAML message using HTTP REDIRECT. Here is the message:</p>
<pre style="overflow: scroll; border: 1px solid #eee"><?php echo $data['message']; ?></pre>
<p>[ <a href="<?php echo htmlentities($data['url']); ?>">send SAML message</a> ]</p>
<h2>Debug mode</h2>
<p>As you are in debug mode you are lucky to see the content of the response you are sending. You can turn off debug mode in the global simpleSAMLphp configuration file <tt>config/config.php</tt>.</p>
<hr />
Copyright &copy; 2007 <a href="http://rnd.feide.no/">Feide RnD</a>
<hr />
</div>
</div>
</body>
</html>
...@@ -44,8 +44,14 @@ $et->data['header'] = 'SAML 2.0 SP Demo Example'; ...@@ -44,8 +44,14 @@ $et->data['header'] = 'SAML 2.0 SP Demo Example';
$et->data['remaining'] = $session->remainingTime(); $et->data['remaining'] = $session->remainingTime();
$et->data['attributes'] = $attributes; $et->data['attributes'] = $attributes;
$et->data['valid'] = $session->isValid() ? 'Session is valid' : 'Session is invalid'; $et->data['valid'] = $session->isValid() ? 'Session is valid' : 'Session is invalid';
$et->data['logout'] = '<p>[ <a href="/' . $config->getValue('baseurlpath') . 'saml2/sp/initSLO.php?RelayState=/' .
$config->getValue('baseurlpath') . 'logout.html">Logout</a> ]';
/*
$et->data['logout'] = '[ <a href="https://sam.feide.no/amserver/saml2/jsp/idpSingleLogoutInit.jsp?binding=urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect">IdP intiated logout from Feide (only if you are connected to the Feide IdP)</a> ]</p> $et->data['logout'] = '[ <a href="https://sam.feide.no/amserver/saml2/jsp/idpSingleLogoutInit.jsp?binding=urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect">IdP intiated logout from Feide (only if you are connected to the Feide IdP)</a> ]</p>
<p>[ <a href="/' . $config->getValue('baseurlpath') . 'saml2/sp/initSLO.php?RelayState=' . urlencode(SimpleSAML_Utilities::selfURL()) . '">SP initated logout</a> ]'; <p>[ <a href="/' . $config->getValue('baseurlpath') . 'saml2/sp/initSLO.php?RelayState=' . urlencode(SimpleSAML_Utilities::selfURL()) . '">SP initated logout</a> ]';
*/
$et->show(); $et->show();
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>simpleSAMLphp Logout</title>
<style type="text/css">
/* these styles are in the head of this page because this is a unique page */
/* THE BIG GUYS */
* {margin:0;padding:0}
body {text-align:center;padding: 20px 0;background: #222;color:#333;font:83%/1.5 arial,tahoma,verdana,sans-serif}
img {border:none;display:block}
hr {margin: 1em 0;background:#eee;height:1px;color:#eee;border:none;clear:both}
/* LINKS */
a,a:link,a:link,a:link,a:hover {font-weight:bold;background:transparent;text-decoration:underline;cursor:pointer}
a:link {color:#c00}
a:visited {color:#999}
a:hover,a:active {color:#069}
/* LISTS */
ul {margin: .3em 0 1.5em 2em}
ul.related {margin-top:-1em}
li {margin-left:2em}
dt {font-weight:bold}
#wrap {border: 1px solid #fff;position:relative;background:#fff;width:600px;margin: 0 auto;text-align:left}
#header {background: #666 url("resources/sprites.gif") repeat-x 0 100%;margin: 0 0 25px;padding: 0 0 8px}
#header h1 {color:#fff;font-size: 145%;padding:20px 20px 12px}
#poweredby {width:96px;height:63px;position:absolute;top:0;right:0}
#content {padding: 0 20px}
/* TYPOGRAPHY */
p, ul, ol {margin: 0 0 1.5em}
h1, h2, h3, h4, h5, h6 {letter-spacing: -1px;font-family: arial,verdana,sans-serif;margin: 1.2em 0 .3em;color:#000;border-bottom: 1px solid #eee;padding-bottom: .1em}
h1 {font-size: 196%;margin-top:0;border:none}
h2 {font-size: 136%}
h3 {font-size: 126%}
h4 {font-size: 116%}
h5 {font-size: 106%}
h6 {font-size: 96%}
.old {text-decoration:line-through}
</style>
</head>
<body>
<div id="wrap">
<div id="header">
<h1>You have logged out</h1>
<div id="poweredby"><img src="resources/icons/compass_l.png" alt="Bino" /></div>
</div>
<div id="content">
<h2>Thanks, and welcome back.</h2>
<p>Thanks for using this service. Now you are logged out using Single Logout.</p>
<p>[ <a href="index.html">Go back to simpleSAMLphp installation page</a> ]</p></p>
<h2>About simpleSAMLphp</h2>
<p>Hey! This simpleSAMLphp thing is pretty cool, where can I read more about it?
You can find more information about simpleSAMLphp at <a href="http://rnd.feide.no">the Feide RnD blog</a> over at <a href="http://uninett.no">UNINETT</a>.</p>
<hr />
Copyright &copy; 2007 <a href="http://rnd.feide.no/">Feide RnD</a>
<hr />
</div>
</div>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment