Skip to content
Snippets Groups Projects
Commit 969271fe authored by Olav Morken's avatar Olav Morken
Browse files

Auth_Default: Extend $hints to be generic parameters for the authentication source.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1996 44740490-163a-0410-bde0-09ae8108e29a
parent 70826728
No related branches found
No related tags found
No related merge requests found
...@@ -22,16 +22,15 @@ class SimpleSAML_Auth_Default { ...@@ -22,16 +22,15 @@ class SimpleSAML_Auth_Default {
* @param string $returnURL The URL we should direct the user to after authentication. * @param string $returnURL The URL we should direct the user to after authentication.
* @param string|NULL $errorURL The URL we should direct the user to after failed authentication. * @param string|NULL $errorURL The URL we should direct the user to after failed authentication.
* Can be NULL, in which case a standard error page will be shown. * Can be NULL, in which case a standard error page will be shown.
* @param array $hints Extra information about the login. Different authentication requestors may * @param array $params Extra information about the login. Different authentication requestors may
* provide different information. Optional, will default to an empty array. * provide different information. Optional, will default to an empty array.
*/ */
public static function initLogin($authId, $returnURL, $errorURL = NULL, $hints = array()) { public static function initLogin($authId, $returnURL, $errorURL = NULL, array $params = array()) {
assert('is_string($authId)'); assert('is_string($authId)');
assert('is_string($returnURL)'); assert('is_string($returnURL)');
assert('is_string($errorURL) || is_null($errorURL)'); assert('is_string($errorURL) || is_null($errorURL)');
assert('is_array($hints)');
$state = array( $state = array_merge($params, array(
'SimpleSAML_Auth_Default.id' => $authId, 'SimpleSAML_Auth_Default.id' => $authId,
'SimpleSAML_Auth_Default.ReturnURL' => $returnURL, 'SimpleSAML_Auth_Default.ReturnURL' => $returnURL,
'SimpleSAML_Auth_Default.ErrorURL' => $errorURL, 'SimpleSAML_Auth_Default.ErrorURL' => $errorURL,
...@@ -39,19 +38,8 @@ class SimpleSAML_Auth_Default { ...@@ -39,19 +38,8 @@ class SimpleSAML_Auth_Default {
'LogoutCallback' => array(get_class(), 'logoutCallback'), 'LogoutCallback' => array(get_class(), 'logoutCallback'),
'LogoutCallbackState' => array( 'LogoutCallbackState' => array(
'SimpleSAML_Auth_Default.logoutSource' => $authId, 'SimpleSAML_Auth_Default.logoutSource' => $authId,
), ),
); ));
if (array_key_exists('SPMetadata', $hints)) {
$state['SPMetadata'] = $hints['SPMetadata'];
}
if (array_key_exists('IdPMetadata', $hints)) {
$state['IdPMetadata'] = $hints['IdPMetadata'];
}
if (array_key_exists(SimpleSAML_Auth_State::RESTART, $hints)) {
$state[SimpleSAML_Auth_State::RESTART] = $hints[SimpleSAML_Auth_State::RESTART];
}
if ($errorURL !== NULL) { if ($errorURL !== NULL) {
$state[SimpleSAML_Auth_State::EXCEPTION_HANDLER_URL] = $errorURL; $state[SimpleSAML_Auth_State::EXCEPTION_HANDLER_URL] = $errorURL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment