PHP Classes

File: web/SSO/modules/core/www/as_login.php

Recommend this page to a friend!
  Classes of william amed   Raptor 2   ???   Download  
File: web/SSO/modules/core/www/???
Role: Example script
Content typex: text/plain
Description: Example script
Class: Raptor 2
Framework that takes routes from annotations
Author: By
Last change:
Date: 9 years ago
Size: 865 bytes
 

Contents

Class file image Download
<?php

/**
 * Endpoint for logging in with an authentication source.
 *
 * @package simpleSAMLphp
 */

if (!is_string($_REQUEST['ReturnTo'])) {
    throw new
SimpleSAML_Error_BadRequest('Missing ReturnTo parameter.');
}

if (!
is_string($_REQUEST['AuthId'])) {
    throw new
SimpleSAML_Error_BadRequest('Missing AuthId parameter.');
}

/*
 * Setting up the options for the requireAuth() call later..
 */
$options = array(
   
'ReturnTo' => SimpleSAML_Utilities::checkURLAllowed($_REQUEST['ReturnTo']),
);

/*
 * Allows a saml:idp query string parameter specify the IdP entity ID to be used
 * as used by the DiscoJuice embedded client.
 */
if (!empty($_REQUEST['saml:idp'])) {
   
$options['saml:idp'] = $_REQUEST['saml:idp'];
}

$as = new SimpleSAML_Auth_Simple($_REQUEST['AuthId']);
$as->requireAuth($options);

SimpleSAML_Utilities::redirectTrustedURL($options['ReturnTo']);