Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/Models/OAuth2/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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'];
Expand Down
4 changes: 2 additions & 2 deletions app/Services/Utils/ServerConfigurationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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_enable', true);
}

public function getUserIdentityEndpointURL($identifier)
Expand Down Expand Up @@ -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');
}
Expand Down
1 change: 1 addition & 0 deletions config/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
return array
(
'ssl_enabled' => env('SSL_ENABLED', false),
'ssl_enable' => env('SSL_ENABLED', false),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is duping "server.ssl_enabled"
please use old key

'db_log_enabled' => env('DB_LOG_ENABLED', false),
'assets_base_url' => env('ASSETS_BASE_URL', null),
'banning_enable' => env('BANNING_ENABLE', true),
Expand Down
2 changes: 2 additions & 0 deletions docker-compose/nginx/idp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading