/** * Construct the Request object. * * @param $get_params the GET parameters associative array */ public function __construct($get_params = array(), $settings = null) { if ($settings == null) { $settings = Maestrano::sso()->getSamlSettings(); } $this->_settings = $settings; $this->_get_params = $get_params; }
/** * Construct the response object. * * @param string $saml_response A UUEncoded SAML response from the IdP. */ public function __construct($saml_response, $settings = null) { if ($settings == null) { $settings = Maestrano::sso()->getSamlSettings(); } $this->_settings = $settings; $this->assertion = base64_decode($saml_response); $this->document = new DOMDocument(); $this->document->loadXML($this->assertion); }
function mno_redirect_user_from_login() { if ($_GET["loggedout"] == 'true') { // Redirect to blog home page $redirect = '/'; } else { // Login - Trigger SSO $redirect = Maestrano::sso()->getInitPath(); } echo "<script type='text/javascript'>window.location = '{$redirect}';</script>"; }
public function __construct() { if (Maestrano::sso()->isSsoEnabled()) { if (!$this->isAdminLogged()) { $samlController = array('init', 'consume'); if (!in_array(Tools::getValue('controller'), $samlController)) { // calling the function generate the cookie for admin directory $this->cookieForAdminDirectory(); Tools::redirect(Tools::getCurrentUrlProtocolPrefix() . Tools::getShopDomain() . __PS_BASE_URI__ . Maestrano::sso()->getInitPath()); } } } }
/** * Perform check to see if session is valid * Check is only performed if current time is after * the recheck timestamp * If a remote check is performed then the mno_session_recheck * timestamp is updated in session. * * @return boolean the validity of the session */ public function isValid($ifSession = false, $httpClient = null) { $svc = Maestrano::sso(); if (!$svc->isSloEnabled()) { return true; } if ($ifSession) { return true; } if (!$this->ssoTokenExists()) { return false; } if ($this->isRemoteCheckRequired()) { if ($this->performRemoteCheck($httpClient)) { $this->save(); return true; } else { return false; } } else { return true; } }
<?php if (!isset($_SESSION)) { session_start(); } // Include Maestrano required libraries require_once 'vendor/maestrano/maestrano-php/lib/Maestrano.php'; Maestrano::configure('maestrano.json'); // Check session validity and trigger SSO if not if (Maestrano::sso()->isSsoEnabled()) { $mnoSession = new Maestrano_Sso_Session($_SESSION); if (!$mnoSession->isValid()) { $_SESSION['mno_previous_uri'] = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; $req = new Maestrano_Saml_Request($_GET); header('Location: ' . $req->getRedirectUrl()); exit; } } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>File Manager</title> <link rel="stylesheet" type="text/css" href="styles/reset.css" /> <link rel="stylesheet" type="text/css" href="scripts/jquery.filetree/jqueryFileTree.css" /> <link rel="stylesheet" type="text/css" href="scripts/jquery.contextmenu/jquery.contextMenu-1.01.css" /> <link rel="stylesheet" type="text/css" href="scripts/custom-scrollbar-plugin/jquery.mCustomScrollbar.min.css" /> <style type="text/css"> #loading-wrap {