13if (!array_key_exists(
'AuthState', $_REQUEST)) {
26if (array_key_exists(
'username', $_REQUEST)) {
27 $username = $_REQUEST[
'username'];
28} elseif (
$source->getRememberUsernameEnabled() && array_key_exists(
$source->getAuthId() .
'-username',
$_COOKIE)) {
30} elseif (isset(
$state[
'core:username'])) {
31 $username = (string)
$state[
'core:username'];
36if (array_key_exists(
'password', $_REQUEST)) {
42if (array_key_exists(
'organization', $_REQUEST)) {
43 $organization = $_REQUEST[
'organization'];
44} elseif (isset(
$state[
'core:organization'])) {
45 $organization = (string)
$state[
'core:organization'];
53 if (!empty($username) && !empty(
$password)) {
55 if (
$source->getRememberUsernameEnabled()) {
57 $params = $sessionHandler->getCookieParams();
59 $params[
'expire'] += (isset($_REQUEST[
'remember_username']) && $_REQUEST[
'remember_username'] ==
'Yes' ? 31536000 : -300);
76$t->data[
'username'] = $username;
77$t->data[
'forceUsername'] = FALSE;
78$t->data[
'rememberUsernameEnabled'] =
$source->getRememberUsernameEnabled();
79$t->data[
'rememberUsernameChecked'] =
$source->getRememberUsernameChecked();
80$t->data[
'rememberMeEnabled'] =
false;
81$t->data[
'rememberMeChecked'] =
false;
82if (isset(
$_COOKIE[
$source->getAuthId() .
'-username']))
$t->data[
'rememberUsernameChecked'] = TRUE;
88 $t->data[
'selectedOrg'] = $organization;
92if (isset(
$state[
'SPMetadata'])) {
93 $t->data[
'SPMetadata'] =
$state[
'SPMetadata'];
95 $t->data[
'SPMetadata'] = NULL;
An exception for terminatinating execution or to throw for unit testing.
static getAllErrorCodeMessages()
Get a map of both errorcode titles and descriptions.
static getSessionHandler()
This function retrieves the current instance of the session handler.
static setCookie($name, $value, $params=null, $throw=true)
Set a cookie.
static getById($authId, $type=null)
Retrieve authentication source.
static loadState($id, $stage, $allowMissing=false)
Retrieve saved state.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
getParameters()
Retrieve the error parameters given when throwing this error.
getErrorCode()
Retrieve the error code given when throwing this error.
const AUTHID
The key of the AuthId field in the state.
static listOrganizations($authStateId)
Get available organizations.
const STAGEID
The string used to identify our states.
static handleLogin($authStateId, $username, $password, $organization)
Handle login request.
if($source===NULL) $organizations
if(!array_key_exists('AuthState', $_REQUEST)) $authStateId
if($organizations===NULL||!empty($organization)) $globalConfig