Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-08-18 13:16:43 +0300
committerLukas Reschke <lukas@statuscode.ch>2017-08-18 13:22:44 +0300
commita04feff9a780d77ca172ba7558a7d0cc4e01dc36 (patch)
tree8c06d3f1d3f7b044161dfcd19dd8db538d149edd /lib/public/Authentication
parent231cffffb9084ed1b7779f40ec07ad617ec71a30 (diff)
Properly allow \OCP\Authentication\IApacheBackend to specify logout URL
Any `\OCP\Authentication\IApacheBackend` previously had to implement `getLogoutAttribute` which returns a string. This string is directly injected into the logout `<a>` tag, so returning something like `href="foo"` would result in `<a href="foo">`. This is rather error prone and also in Nextcloud 12 broken as the logout entry has been moved with 054e161eb5f4a5c5c13ee322ae8e93ce66f01b13 inside the navigation manager where one cannot simply inject attributes. Thus this feature is broken in Nextcloud 12 which effectively leads to the bug described at nextcloud/user_saml#112, people cannot logout anymore when using SAML using SLO. Basically in case of SAML you have a SLO url which redirects you to the IdP and properly logs you out there as well. Instead of monkey patching the Navigation manager I decided to instead change `\OCP\Authentication\IApacheBackend` to use `\OCP\Authentication\IApacheBackend::getLogoutUrl` instead where it can return a string with the appropriate logout URL. Since this functionality is only prominently used in the SAML plugin. Any custom app would need a small change but I'm not aware of any and there's simply no way to fix this properly otherwise. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib/public/Authentication')
-rw-r--r--lib/public/Authentication/IApacheBackend.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/public/Authentication/IApacheBackend.php b/lib/public/Authentication/IApacheBackend.php
index 908bc5ace3d..7d43d438cbb 100644
--- a/lib/public/Authentication/IApacheBackend.php
+++ b/lib/public/Authentication/IApacheBackend.php
@@ -39,21 +39,20 @@ namespace OCP\Authentication;
interface IApacheBackend {
/**
- * In case the user has been authenticated by Apache true is returned.
+ * In case the user has been authenticated by a module true is returned.
*
- * @return boolean whether Apache reports a user as currently logged in.
+ * @return boolean whether the module reports a user as currently logged in.
* @since 6.0.0
*/
public function isSessionActive();
/**
- * Creates an attribute which is added to the logout hyperlink. It can
- * supply any attribute(s) which are valid for <a>.
+ * Gets the current logout URL
*
- * @return string with one or more HTML attributes.
- * @since 6.0.0
+ * @return string
+ * @since 12.0.3
*/
- public function getLogoutAttribute();
+ public function getLogoutUrl();
/**
* Return the id of the current user