18 const STAGEID =
'sspmod_core_Auth_UserPassBase.state';
24 const AUTHID =
'sspmod_core_Auth_UserPassBase.AuthId';
85 assert(is_array(
$info));
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);
180 if ($this->forcedUsername !== NULL) {
190 if (isset(
$state[
'core:auth:username']) && isset(
$state[
'core:auth:password'])) {
191 $username =
$state[
'core:auth:username'];
194 if (isset(
$state[
'forcedUsername'])) {
195 $username =
$state[
'forcedUsername'];
250 assert(is_string($username));
257 assert(array_key_exists(self::AUTHID,
$state));
260 throw new Exception(
'Could not find authentication source with id ' .
$state[self::AUTHID]);
278 /* Save the attributes we received from the login-function in the $state-array. */ 279 assert(is_array($attributes)); 280 $state['Attributes
'] = $attributes; 282 /* Return control to SimpleSAMLphp after successful authentication. */ 283 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.
if(array_key_exists('yes', $_REQUEST)) $attributes
__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.