16 const AUTHID =
'sspmod_multiauth_Auth_Source_MultiAuth.AuthId';
21 const STAGEID =
'sspmod_multiauth_Auth_Source_MultiAuth.StageId';
26 const SOURCESID =
'sspmod_multiauth_Auth_Source_MultiAuth.SourceId';
45 assert(
'is_array($info)');
46 assert(
'is_array($config)');
51 if (!array_key_exists(
'sources',
$config)) {
52 throw new Exception(
'The required "sources" config option was not found');
56 $defaultLanguage = $globalConfiguration->getString(
'language.default',
'en');
58 $this->sources =
array();
66 if (array_key_exists(
'text',
$info)) {
72 if (array_key_exists(
'css-class',
$info)) {
73 $css_class =
$info[
'css-class'];
76 $authconfig = $authsources->getArray(
$source, NULL);
77 if (!array_key_exists(0, $authconfig) || !is_string($authconfig[0])) {
80 $css_class = str_replace(
":",
"-", $authconfig[0]);
84 $this->sources[] =
array(
87 'css_class' => $css_class,
105 assert(
'is_array($state)');
119 if(isset(
$_GET[
'source'])) {
142 assert(
'is_string($authId)');
143 assert(
'is_array($state)');
146 $valid_sources = array_map(
148 return $src[
'source'];
152 if (
$as === NULL || !in_array(
$authId, $valid_sources,
true)) {
180 assert(
'is_array($state)');
188 throw new Exception(
'Invalid authentication source during logout: ' .
$source);
203 assert(
'is_string($source)');
210 'lifetime' => (60*60*24*90),
213 'path' =>
$config->getBasePath(),
const SESSION_SOURCE
The key where the selected source is saved in the session.
authenticate(&$state)
Prompt the user with a list of authentication sources.
static throwException($state, SimpleSAML_Error_Exception $exception)
Throw exception to the state exception handler.
getPreviousSource()
Get the previous authentication source.
static delegateAuthentication($authId, $state)
Delegate authentication.
logout(&$state)
Log out from this authentication source.
if(!array_key_exists('StateId', $_REQUEST)) $id
static redirectTrustedURL($url, $parameters=array())
This function redirects to the specified URL without performing any security checks.
const AUTHID
The key of the AuthId field in the state.
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
static setCookie($name, $value, $params=null, $throw=true)
Set a cookie.
setPreviousSource($source)
Set the previous authentication source.
const DATA_TIMEOUT_SESSION_END
This is a timeout value for setData, which indicates that the data should never be deleted...
static getConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
const SOURCESID
The key where the sources is saved in the state.
Create styles array
The data for the language used.
const STAGEID
The string used to identify our states.
static completeAuth(&$state)
Complete authentication.
$sources
Array of sources we let the user chooses among.
static getById($authId, $type=null)
Retrieve authentication source.
static getSessionFromRequest()
Retrieves the current session.
static saveState(&$state, $stage, $rawId=false)
Save the state.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
__construct($info, $config)
Constructor for this authentication source.