I apologize if this was solved somewhere, but I can't found solution.
I tried code from https://groups.google.com/d/msg/simplesamlphp/k8KSZN916KM/3-buwpft0_0J
Need help with identifying on SP side if user has authenticated on IdP. Infrastructure (everything on one shared hosting):
login.domain.com (IdP)
www.domain.com (SP)
www.domain2.com (SP)
From domain.com I'm redirected to login.domain.com (IdP) where I successfully login and be redirected to domain.com. I open site domain2.com (SP) and want to be authenticated, without the need to click on login, be redirected to IdP and back (without typing username, pass).
HTTP-Artifact is the solution, or some kind of SOAP solution? Tried with cURL and than read that it can't be done with cURL.
Tried memcache with same session.cookie.domain = 'domain.com';
Is there a solution to get auth session from the IdP, something like when I log in to Gmail and than click on Youtube I'm already logged in without clicking on log in.
Logout works out of the box.
Big thanks for any suggestions, ideas.
Caused by: SimpleSAML_Error_NoPassive: Passive authentication not supported.
SimpleSAML_Error_Error: UNHANDLEDEXCEPTION
Backtrace: 0 /home/roland/DEV/Genesis/symfony/vendor/Mailclub/saml-bundle/Mailclub/SamlBundle/Lib/simplesamlphp/www/module.php:180 (N/A) Caused by: SimpleSAML_Error_NoPassive: Passive authentication not supported. Backtrace: 2 /home/roland/DEV/Genesis/symfony/vendor/Mailclub/saml-bundle/Mailclub/SamlBundle/Lib/simplesamlphp/modules/saml/lib/Error.php:161 (sspmod_saml_Error::toException) 1 /home/roland/DEV/Genesis/symfony/vendor/Mailclub/saml-bundle/Mailclub/SamlBundle/Lib/simplesamlphp/modules/saml/www/sp/saml2-acs.php:78 (require) 0 /home/roland/DEV/Genesis/symfony/vendor/Mailclub/saml-bundle/Mailclub/SamlBundle/Lib/simplesamlphp/www/module.php:135 (N/A) Caused by: sspmod_saml_Error: Responder/NoPassive: Passive authentication not supported. Backtrace: 3 /home/roland/DEV/Genesis/symfony/vendor/Mailclub/saml-bundle/Mailclub/SamlBundle/Lib/simplesamlphp/modules/saml/lib/Message.php:371 (sspmod_saml_Message::getResponseError) 2 /home/roland/DEV/Genesis/symfony/vendor/Mailclub/saml-bundle/Mailclub/SamlBundle/Lib/simplesamlphp/modules/saml/lib/Message.php:498 (sspmod_saml_Message::processResponse) 1 /home/roland/DEV/Genesis/symfony/vendor/Mailclub/saml-bundle/Mailclub/SamlBundle/Lib/simplesamlphp/modules/saml/www/sp/saml2-acs.php:75 (require) 0 /home/roland/DEV/Genesis/symfony/vendor/Mailclub/saml-bundle/Mailclub/SamlBundle/Lib/simplesamlphp/www/module.php:135 (N/A)
<?php
require_once (__DIR__ . '/simplesaml/_include.php');
$as = new SimpleSAML_Auth_Simple('bx-sp');
$isAuthenticated = $as->isAuthenticated();
print "isAuthenticated: " . ($isAuthenticated ? "yes" : "no") . "\n";
?>
<html>
<head>
<meta charset="utf-8">
<title>Page with login</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.1.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
<? if ($isAuthenticated) { ?>
<script>
function opendialog(page) {
var $dialog = $('#logoutOverlay')
.html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>')
.dialog({
title: "Logout",
autoOpen: false,
dialogClass: 'dialog_fixed,ui-widget-header',
modal: true,
height: 270,
minWidth: 400,
minHeight: 270,
draggable:true,
close: function () {
location.reload();
},
buttons: {
"Ok":
function () {
$(this).dialog("close");
}
}
});
$dialog.dialog('open');
}
</script>
</head>
<body>
<div style="cursor: pointer;" id="logoutButton">Logout!</div>
<script>
$("#logoutButton").click(function() {
opendialog("http://www.mysp.de/simplesaml/module.php/core/authenticate.php?as=default-sp&logout");
});
</script>
<div id="logoutOverlay"></div>
<? } else { ?>
</head>
<body>
<div style="cursor: pointer;" id="loginButton">Show Login Box</div>
<div id="loginBox" style="visibility: hidden; width: 0px; height: 0px;">
<iframe style="border: 0px;" src="simpleSamlAuth.php" width="100%" height="100%"></iframe>
</div>
<span id="statusFeld">Visibility: hidden<span>
<script>
function toggleLoginBox() {
if ($('#loginBox').is(":visible") ) {
$('#loginBox').hidden();
} else {
$('#loginBox').visible();
}
}
(function($) {
$.fn.hidden = function() {
$('#statusFeld').html('Visibility: hidden');
return this.each(function() {
$(this).css("visibility", "hidden");
$(this).css("width", "0");
$(this).css("height", "0");
});
};
$.fn.visible = function() {
$('#statusFeld').html('Visibility: visible');
return this.each(function() {
$(this).css("visibility", "visible");
$(this).css("width", "auto");
$(this).css("height", "auto");
});
};
}(jQuery));
$("#loginButton").click(function() {
toggleLoginBox();
});
</script>
<? } ?>
</body>
</html>
And the code of the sub-page:
<?php
require_once (__DIR__ . '/simplesaml/_include.php');
$as = new SimpleSAML_Auth_Simple('default-sp');
$as->requireAuth();
?>
<script>
window.parent.location.reload();
</script>
Any comments and hints are more than welcome, but - up to now, it's only a test page and far from being perfect, so please be kind... ;-)