예제 #1
0
function onelogin_saml_metadata()
{
    $auth = initialize_saml();
    $auth = new Onelogin_Saml2_Auth($settings);
    $settings = $auth->getSettings();
    $metadata = $settings->getSPMetadata();
    header('Content-Type: text/xml');
    echo $metadata;
    exit;
}
예제 #2
0
    print_error('retriesexceeded', 'auth_onelogin_saml', '', $retry);
}
$SESSION->saml_retry_count = $retry + 1;
// save the jump target - this is checked later that it starts with $CFG->wwwroot, and cleaned
if (isset($_GET['wantsurl'])) {
    $wantsurl = $SESSION->wantsurl = $_GET['wantsurl'];
}
// check for a wantsurl in the existing Moodle session
if (empty($wantsurl) && isset($SESSION->wantsurl)) {
    $wantsurl = $SESSION->wantsurl;
}
// get the plugin config for saml
$pluginconfig = get_config('auth/onelogin_saml');
require_once '_toolkit_loader.php';
$settings = auth_onelogin_saml_get_settings();
$auth = new Onelogin_Saml2_Auth($settings);
if (isset($_GET['logout']) && $_GET['logout']) {
    if (isset($_GET['RelayState']) && !empty($_GET['RelayState'])) {
        $location = $_GET['RelayState'];
    } else {
        if (isset($wantsurl)) {
            $location = $wantsurl;
        } else {
            $location = $CFG->wwwroot;
        }
    }
    if (isset($_GET['normal'])) {
        auth_onelogin_saml_deleteLocalSession();
    } else {
        if (isset($_GET) && (isset($_GET['SAMLRequest']) || isset($_GET['SAMLResponse']))) {
            // Delete the local session must be done on processSLO
예제 #3
0
<?php

error_reporting(E_ALL);
require '_toolkit_loader.php';
require 'settings.php';
try {
    $auth = new Onelogin_Saml2_Auth($settings);
    $auth->login();
} catch (Exception $e) {
    drupal_set_message("The Onelogin SSO/SAML plugin is not correctly configured.", 'error', FALSE);
    exit;
}