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

SimpleSAML_Auth_Simple: Add ReturnCallback.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2607 44740490-163a-0410-bde0-09ae8108e29a
parent 3b40ce62
No related branches found
No related tags found
No related merge requests found
...@@ -98,6 +98,10 @@ The following global parameters are supported: ...@@ -98,6 +98,10 @@ The following global parameters are supported:
: The URL the user should be returned to after authentication. : The URL the user should be returned to after authentication.
The default is to return the user to the current page. The default is to return the user to the current page.
`ReturnCallback` (`array`)
: The function we should call when the user finishes authentication.
The [`saml:SP`](./saml:sp) authentication source also defines some parameters. The [`saml:SP`](./saml:sp) authentication source also defines some parameters.
......
...@@ -83,6 +83,8 @@ class SimpleSAML_Auth_Simple { ...@@ -83,6 +83,8 @@ class SimpleSAML_Auth_Simple {
* - 'KeepPost': If the current request is a POST request, keep the POST * - 'KeepPost': If the current request is a POST request, keep the POST
* data until after the authentication. * data until after the authentication.
* - 'ReturnTo': The URL the user should be returned to after authentication. * - 'ReturnTo': The URL the user should be returned to after authentication.
* - 'ReturnCallback': The function we should call after the user has
* finished authentication.
* *
* @param array $params Various options to the authentication request. * @param array $params Various options to the authentication request.
*/ */
...@@ -96,6 +98,8 @@ class SimpleSAML_Auth_Simple { ...@@ -96,6 +98,8 @@ class SimpleSAML_Auth_Simple {
if (array_key_exists('ReturnTo', $params)) { if (array_key_exists('ReturnTo', $params)) {
$returnTo = (string)$params['ReturnTo']; $returnTo = (string)$params['ReturnTo'];
} else if (array_key_exists('ReturnCallback', $params)) {
$returnTo = (array)$params['ReturnCallback'];
} else { } else {
$returnTo = SimpleSAML_Utilities::selfURL(); $returnTo = SimpleSAML_Utilities::selfURL();
} }
...@@ -111,7 +115,7 @@ class SimpleSAML_Auth_Simple { ...@@ -111,7 +115,7 @@ class SimpleSAML_Auth_Simple {
} }
if (!isset($params[SimpleSAML_Auth_State::RESTART])) { if (!isset($params[SimpleSAML_Auth_State::RESTART]) && is_string($returnTo)) {
/* /*
* An URL to restart the authentication, in case the user bookmarks * An URL to restart the authentication, in case the user bookmarks
* something, e.g. the discovery service page. * something, e.g. the discovery service page.
......
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