diff --git a/app/Models/OAuth2/Client.php b/app/Models/OAuth2/Client.php index c01be875..b953be9b 100644 --- a/app/Models/OAuth2/Client.php +++ b/app/Models/OAuth2/Client.php @@ -809,9 +809,9 @@ public function isOriginAllowed(string $origin):bool { $originWithoutPort = URLUtils::canonicalUrl($origin, false); if(empty($originWithoutPort)) return false; - if(str_contains($this->allowed_origins, URLUtils::normalizeUrl($originWithoutPort) )) return true; + if(str_contains($this->allowed_origins, rtrim(URLUtils::normalizeUrl($originWithoutPort), '/') )) return true; $originWithPort = URLUtils::canonicalUrl($origin); - return str_contains($this->allowed_origins, URLUtils::normalizeUrl($originWithPort)); + return str_contains($this->allowed_origins, rtrim(URLUtils::normalizeUrl($originWithPort), '/')); } public function getWebsite() @@ -1097,7 +1097,7 @@ public function isPostLogoutUriAllowed($post_logout_uri) if ($parts == false) { return false; } - if($parts['scheme']!=='https') + if($parts['scheme']!=='https' && ServerConfigurationService::getConfigValue("SSL.Enable")) return false; $logout_without_port = $parts['scheme'].'://'.$parts['host']; diff --git a/app/Services/Utils/ServerConfigurationService.php b/app/Services/Utils/ServerConfigurationService.php index 70870f62..b3d2817b 100644 --- a/app/Services/Utils/ServerConfigurationService.php +++ b/app/Services/Utils/ServerConfigurationService.php @@ -159,7 +159,7 @@ public function __construct( $this->default_config_params["OAuth2SecurityPolicy.MaxInvalidRedeemAuthCodeAttempts"] = Config::get('server.OAuth2SecurityPolicy_MaxInvalidRedeemAuthCodeAttempts', 10); $this->default_config_params["OAuth2SecurityPolicy.MaxInvalidClientCredentialsAttempts"] = Config::get('server.OAuth2SecurityPolicy_MaxInvalidClientCredentialsAttempts', 5); //ssl - $this->default_config_params["SSL.Enable"] = Config::get('server.SSL_Enable', true); + $this->default_config_params["SSL.Enable"] = Config::get('server.ssl_enabled', true); } public function getUserIdentityEndpointURL($identifier) @@ -250,7 +250,7 @@ public function getSiteUrl():string $request = request(); if(!is_null($request)) { - return 'https://'.$request->getHttpHost(); + return $request->getSchemeAndHttpHost(); } return Config::get('app.url'); } diff --git a/docker-compose/nginx/idp.conf b/docker-compose/nginx/idp.conf index 4c6cbf44..55e9f0c9 100644 --- a/docker-compose/nginx/idp.conf +++ b/docker-compose/nginx/idp.conf @@ -12,6 +12,8 @@ server { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_buffers 16 16k; + fastcgi_buffer_size 32k; } location / { try_files $uri $uri/ /index.php?$query_string;