mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-04-26 06:20:08 +02:00
baseurl is expected to be the host name and protocol without path
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
parent
1109cb663c
commit
69a6484257
|
@ -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(
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue