diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-08-01 18:17:32 +0300 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2017-08-01 18:17:32 +0300 |
commit | 69a6484257033cac41c7c25dee8aa7d590467c88 (patch) | |
tree | 50405ac2a2b06c9bad39bd7931bc00208d0d2133 | |
parent | 1109cb663ce4778b3e1e06057f444e117f894541 (diff) |
baseurl is expected to be the host name and protocol without path
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
-rw-r--r-- | appinfo/app.php | 3 | ||||
-rw-r--r-- | lib/AppInfo/Application.php | 3 | ||||
-rw-r--r-- | lib/SAMLSettings.php | 10 |
3 files changed, 10 insertions, 6 deletions
diff --git a/appinfo/app.php b/appinfo/app.php index 1c672001..d0246488 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -35,7 +35,8 @@ $request = \OC::$server->getRequest(); $userSession = \OC::$server->getUserSession(); $samlSettings = new \OCA\User_SAML\SAMLSettings( $urlGenerator, - $config + $config, + $request ); $userBackend = new \OCA\User_SAML\UserBackend( diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index cc292505..0a7a2429 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -21,10 +21,7 @@ namespace OCA\User_SAML\AppInfo; -use OCA\User_SAML\Controller\SAMLController; use OCA\User_SAML\Middleware\OnlyLoggedInMiddleware; -use OCA\User_SAML\SAMLSettings; -use OCA\User_SAML\UserBackend; use OCP\AppFramework\App; use OCP\AppFramework\IAppContainer; diff --git a/lib/SAMLSettings.php b/lib/SAMLSettings.php index 2d30ff9e..380f2d70 100644 --- a/lib/SAMLSettings.php +++ b/lib/SAMLSettings.php @@ -23,6 +23,7 @@ namespace OCA\User_SAML; use OCP\AppFramework\Http; use OCP\IConfig; +use OCP\IRequest; use OCP\IURLGenerator; class SAMLSettings { @@ -30,22 +31,27 @@ class SAMLSettings { private $urlGenerator; /** @var IConfig */ private $config; + /** @var IRequest */ + private $request; /** * @param IURLGenerator $urlGenerator * @param IConfig $config + * @param IRequest $request */ public function __construct(IURLGenerator $urlGenerator, - IConfig $config) { + IConfig $config, + IRequest $request) { $this->urlGenerator = $urlGenerator; $this->config = $config; + $this->request = $request; } public function getOneLoginSettingsArray() { $settings = [ 'strict' => true, 'debug' => $this->config->getSystemValue('debug', false), - 'baseurl' => $this->urlGenerator->getAbsoluteURL('/'), + 'baseurl' => $this->request->getServerProtocol() . '://' . $this->request->getServerHost(), 'security' => [ 'nameIdEncrypted' => ($this->config->getAppValue('user_saml', 'security-nameIdEncrypted', '0') === '1') ? true : false, 'authnRequestsSigned' => ($this->config->getAppValue('user_saml', 'security-authnRequestsSigned', '0') === '1') ? true : false, |