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

github.com/nextcloud/user_saml.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-08-01 18:17:32 +0300
committerLukas Reschke <lukas@statuscode.ch>2017-08-01 18:17:32 +0300
commit69a6484257033cac41c7c25dee8aa7d590467c88 (patch)
tree50405ac2a2b06c9bad39bd7931bc00208d0d2133 /lib/SAMLSettings.php
parent1109cb663ce4778b3e1e06057f444e117f894541 (diff)
baseurl is expected to be the host name and protocol without path
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib/SAMLSettings.php')
-rw-r--r--lib/SAMLSettings.php10
1 files changed, 8 insertions, 2 deletions
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,