18 const STAGEID =
'sspmod_core_Auth_UserPassBase.state';
24 const AUTHID =
'sspmod_core_Auth_UserPassBase.AuthId';
85 assert(
'is_array($info)');
86 assert(
'is_array($config)');
88 if (isset(
$config[
'core:loginpage_links'])) {
89 $this->loginLinks =
$config[
'core:loginpage_links'];
96 if (isset(
$config[
'remember.username.enabled'])) {
97 $this->rememberUsernameEnabled = (bool)
$config[
'remember.username.enabled'];
98 unset(
$config[
'remember.username.enabled']);
100 if (isset(
$config[
'remember.username.checked'])) {
101 $this->rememberUsernameChecked = (bool)
$config[
'remember.username.checked'];
102 unset(
$config[
'remember.username.checked']);
107 $this->rememberMeEnabled = $sspcnf->getBoolean(
'session.rememberme.enable', FALSE);
108 $this->rememberMeChecked = $sspcnf->getBoolean(
'session.rememberme.checked', FALSE);
118 assert(
'is_string($forcedUsername) || is_null($forcedUsername)');
170 assert(
'is_array($state)');
180 if ($this->forcedUsername !== NULL) {
232 assert(
'is_string($authStateId)');
233 assert(
'is_string($username)');
234 assert(
'is_string($password)');
240 assert(
'array_key_exists(self::AUTHID, $state)');
243 throw new Exception(
'Could not find authentication source with id ' .
$state[self::AUTHID]);
261 /* Save the attributes we received from the login-function in the $state-array. */ 263 $state['Attributes
'] = $attributes; 265 /* Return control to SimpleSAMLphp after successful authentication. */ 266 SimpleSAML_Auth_Source::completeAuth($state);
static handleLogin($authStateId, $username, $password)
Handle login request.
setForcedUsername($forcedUsername)
Set forced username.
getLoginLinks()
Return login links from configuration.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
if(!array_key_exists('StateId', $_REQUEST)) $id
static redirectTrustedURL($url, $parameters=array())
This function redirects to the specified URL without performing any security checks.
getRememberUsernameChecked()
Getter for the authsource config option remember.username.checked.
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
isRememberMeChecked()
Check if the "remember me" checkbox should be checked.
const AUTHID
The key of the AuthId field in the state.
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
$loginLinks
Links to pages from login page.
login($username, $password)
Attempt to log in using the given username and password.
const STAGEID
The string used to identify our states.
$forcedUsername
Username we should force.
static loadState($id, $stage, $allowMissing=false)
Retrieve saved state.
authenticate(&$state)
Initialize login.
Create styles array
The data for the language used.
__construct($info, &$config)
Constructor for this authentication source.
isRememberMeEnabled()
Check if the "remember me" feature is enabled.
getRememberUsernameEnabled()
Getter for the authsource config option remember.username.enabled.
static getById($authId, $type=null)
Retrieve authentication source.
if(!array_key_exists('AuthState', $_REQUEST)) $authStateId
static saveState(&$state, $stage, $rawId=false)
Save the state.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.