@@ -79,6 +79,7 @@ public function requireAuth(array $params = array()) {
7979 * This function accepts an array $params, which controls some parts of
8080 * the authentication. The accepted parameters depends on the authentication
8181 * source being used. Some parameters are generic:
82+ * - 'ErrorURL': An URL that should receive errors from the authentication.
8283 * - 'KeepPost': If the current request is a POST request, keep the POST
8384 * data until after the authentication.
8485 * - 'ReturnTo': The URL the user should be returned to after authentication.
@@ -103,6 +104,13 @@ public function login(array $params = array()) {
103104 $ returnTo = SimpleSAML_Utilities::createPostRedirectLink ($ returnTo , $ _POST );
104105 }
105106
107+ if (array_key_exists ('ErrorURL ' , $ params )) {
108+ $ errorURL = (string )$ params ['ErrorURL ' ];
109+ } else {
110+ $ errorURL = NULL ;
111+ }
112+
113+
106114 /*
107115 * An URL to restart the authentication, in case the user bookmarks
108116 * something, e.g. the discovery service page.
@@ -111,7 +119,7 @@ public function login(array $params = array()) {
111119
112120 $ params [SimpleSAML_Auth_State::RESTART ] = $ restartURL ;
113121
114- SimpleSAML_Auth_Default::initLogin ($ this ->authSource , $ returnTo , NULL , $ params );
122+ SimpleSAML_Auth_Default::initLogin ($ this ->authSource , $ returnTo , $ errorURL , $ params );
115123 assert ('FALSE ' );
116124 }
117125
0 commit comments