New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clicking on table header don't sort by fieldname when using SignON Auth #16058
Comments
|
Same problem for me. |
|
I test 2 configurations
I have the same problem. |
|
Can you try latest 5.0 version in case it would be fixed, but anyway I will try to have a look and fix the request if 5.0 is affected |
|
I try all versions : 4.9.0 to 5.0.2 |
|
confirm same problem, aftrer updating from 4.9.0 to 5.0.2 |
|
If anyone can make a patch before me I will be very glad to approve any pull-request to QA_5_0 branch |
|
Maybe related to ecb5faa. |
|
I do not understand where the issue is, I tried a multi server setup using server n°2 and a single server setup and was able to order the columns and do all the actions I wanted. if (($_SERVER['HTTP_HOST'] ?? '') === 'pma.sso.local') {
$i = 0;
$cfg['Servers'] = [];
$i++;
$cfg['Servers'][$i]['verbose'] = 'MariaDB 10.4 SSO';
$cfg['Servers'][$i]['host'] = 'mariadb104.williamdes.local';
$cfg['Servers'][$i]['port'] = 3306;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Servers'][$i]['auth_type'] = 'signon';
$cfg['Servers'][$i]['SignonSession'] = 'SignonSession';
$cfg['Servers'][$i]['SignonURL'] = 'http://pma.sso.local/signon-pma.php';
$cfg['Servers'][$i]['LogoutURL'] = 'http://pma.sso.local/signon-pma.php?logout=true';
} |
|
SSO is working correctly as we are being connected on PMA. The problem is when using SSO (it works fine with standard login on same config and version), sql_query parameter on url sql.php is not being treated. Parameter is displayed fine in url but not beeing used on the real query. On the contrary parameter table is working fine, changing it manually triggers a change. |
|
🤔 I still could not reproduce this issue, maybe because what I am testing is not the right things. |
|
I don't think a screenshot will help, every click on columns header to order the tables isn't working. We have 2 configurations, the first one is for connecting with regular login/password and the second one is for connecting with SSO. We use a button in our extranet to connect to PMA directly. Here is our code that open PMA with automatic SSO connexion maybe this can help ? ini_set('session.use_cookies', 'true');
$secure_cookie = false;
session_set_cookie_params(0, '/', '', $secure_cookie, true);
$session_name = 'SignonSessionXXX';
session_name($session_name);
@session_start();
$_SESSION['PMA_single_signon_user'] = 'xxx';
$_SESSION['PMA_single_signon_password'] = $_POST['yyy'];
$_SESSION['PMA_single_signon_host'] = 'localhost';
$_SESSION['PMA_single_signon_port'] = '';
$_SESSION['PMA_single_signon_token'] = md5(uniqid(strval(rand()), true));
$id = session_id();
@session_write_close();
header('Location: /phpMyAdmin/index.php?server=2');I suspect the server=2 is breaking something in the url process. |
|
🎉 I can now see the 🐛 $i = 0;
$cfg['Servers'] = [];
$i++;
$cfg['Servers'][$i]['verbose'] = 'SSO light';
$cfg['Servers'][$i]['auth_type'] = 'signon';
$cfg['Servers'][$i]['SignonSession'] = 'SignonSession';
$cfg['Servers'][$i]['SignonURL'] = 'http://pma.sso.local/signon-pma.php';
$cfg['Servers'][$i]['LogoutURL'] = 'http://pma.sso.local/signon-pma.php?logout=true';
$i++;
$cfg['Servers'][$i]['verbose'] = 'MariaDB 10.4 SSO';
$cfg['Servers'][$i]['host'] = 'mariadb104.williamdes.local';
$cfg['Servers'][$i]['port'] = 3306;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Servers'][$i]['auth_type'] = 'signon';
$cfg['Servers'][$i]['SignonSession'] = 'SignonSession';
$cfg['Servers'][$i]['SignonURL'] = 'http://pma.sso.local/signon-pma.php';
$cfg['Servers'][$i]['LogoutURL'] = 'http://pma.sso.local/signon-pma.php?logout=true';The server parameter is clearly missing on all the queries. |
|
I'm sorry, I forgot to mention that information. If I use a form in signon.php. Indeed there is no problem. But I use Signon authentication to avoid manual entry. |
|
I found out that the issue is with the session hmac secret diff --git a/libraries/classes/Core.php b/libraries/classes/Core.php
index a6b791b6a6..659401ac53 100644
--- a/libraries/classes/Core.php
+++ b/libraries/classes/Core.php
@@ -1285,7 +1285,7 @@ class Core
{
/** @var array $cfg */
global $cfg;
- $secret = $_SESSION[' HMAC_secret '] ?? '';
+ $secret = 'blob' ?? '';
return hash_hmac('sha256', $sqlQuery, $secret . $cfg['blowfish_secret']);
}
@@ -1300,7 +1300,7 @@ class Core
{
/** @var array $cfg */
global $cfg;
- $secret = $_SESSION[' HMAC_secret '] ?? '';
+ $secret = 'blob' ?? '';
$hmac = hash_hmac('sha256', $sqlQuery, $secret . $cfg['blowfish_secret']);
return hash_equals($hmac, $signature);
}or diff --git a/libraries/classes/Plugins/Auth/AuthenticationSignon.php b/libraries/classes/Plugins/Auth/AuthenticationSignon.php
index 36b1d6699f..e0fb2bfa46 100644
--- a/libraries/classes/Plugins/Auth/AuthenticationSignon.php
+++ b/libraries/classes/Plugins/Auth/AuthenticationSignon.php
@@ -216,7 +216,7 @@ class AuthenticationSignon extends AuthenticationPlugin
/* Restore our token */
if (! empty($pma_token)) {
$_SESSION[' PMA_token '] = $pma_token;
- $_SESSION[' HMAC_secret '] = Util::generateRandom(16);
+ $_SESSION[' HMAC_secret '] = 'blob';
}
/** |
|
@MauricioFauth what do you think about that solution ? diff --git a/libraries/classes/Plugins/Auth/AuthenticationSignon.php b/libraries/classes/Plugins/Auth/AuthenticationSignon.php
index 36b1d6699f..6d6b01264e 100644
--- a/libraries/classes/Plugins/Auth/AuthenticationSignon.php
+++ b/libraries/classes/Plugins/Auth/AuthenticationSignon.php
@@ -186,6 +186,11 @@ class AuthenticationSignon extends AuthenticationPlugin
$pma_token = $_SESSION['PMA_single_signon_token'];
}
+ $HMACSecret = Util::generateRandom(16);
+ if (isset($_SESSION['PMA_single_signon_HMAC_secret'])) {
+ $HMACSecret = $_SESSION['PMA_single_signon_HMAC_secret'];
+ }
+
/* End single signon session */
if (! defined('TESTSUITE')) {
session_write_close();
@@ -216,7 +221,7 @@ class AuthenticationSignon extends AuthenticationPlugin
/* Restore our token */
if (! empty($pma_token)) {
$_SESSION[' PMA_token '] = $pma_token;
- $_SESSION[' HMAC_secret '] = Util::generateRandom(16);
+ $_SESSION[' HMAC_secret '] = $HMACSecret;
}
/**
I added For some odd reason I am unable to retrieve the |
I think it's a good solution for now. |
Signed-off-by: William Desportes <williamdes@wdes.fr>
Signed-off-by: William Desportes <williamdes@wdes.fr>
Describe the bug
I authenticate with SignOn, display a table and click on one fieldname in the table header.
After displaying "loading in progress", the sort was not included in the SQL query.
This problem is found for any version higher than 4.9.2
To Reproduce
Expected behavior
I should have a sort by fieldname I clicked on in the table header.
Server configuration
Client configuration
The text was updated successfully, but these errors were encountered: