diff --git a/lib/SAMLSettings.php b/lib/SAMLSettings.php index 6d29d11a0..28e089ef8 100644 --- a/lib/SAMLSettings.php +++ b/lib/SAMLSettings.php @@ -11,9 +11,11 @@ use OCA\User_SAML\Db\ConfigurationsMapper; use OCP\DB\Exception; use OCP\IConfig; +use OCP\IRequest; use OCP\ISession; use OCP\IURLGenerator; use OneLogin\Saml2\Constants; +use OneLogin\Saml2\Utils; class SAMLSettings { private const LOADED_NONE = 0; @@ -77,7 +79,11 @@ public function __construct( private IConfig $config, private ISession $session, private ConfigurationsMapper $mapper, + private IRequest $request, ) { + Utils::setSelfProtocol($this->request->getServerProtocol()); + Utils::setSelfHost($this->request->getServerHost()); + Utils::setProxyVars(true); } /**