Skip to content
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

ZeroConf not working when using SSO #16906

Closed
clementmoulin opened this issue May 16, 2021 · 12 comments
Closed

ZeroConf not working when using SSO #16906

clementmoulin opened this issue May 16, 2021 · 12 comments
Assignees
Labels
Bug A problem or regression with an existing feature
Projects
Milestone

Comments

@clementmoulin
Copy link

Describe the bug

Using SSO with multiple servers, we are using PMA_single_signon_cfgupdate to send all parameters (because unfortunely SSO does not allow us to use config file).

Relations tables works if they are created, but if not, we cannot create it through GUI or with ZeroConf parameter.

To Reproduce

Enable SSO login.
Send all relations parameters through SSO session into PMA_single_signon_cfgupdate.

Expected behavior

Users should be able to create missing tables.

@williamdes
Copy link
Member

Bonjour @clementmoulin

So you are using https://docs.phpmyadmin.net/en/latest/setup.html#auth-signon

Could you provide the script so I can replicate your setup locally please ?

Users should be able to create missing tables.

You mean to fix a phpMyAdmin broken configuration storage setup ?

@williamdes williamdes added the question Used when we need feedback from the submitter or when the issue is a question about PMA label May 20, 2021
@williamdes williamdes added this to Needs triage in Questions via automation May 20, 2021
@williamdes williamdes moved this from Needs triage to Needs a second check to be a bug in Questions May 20, 2021
@clementmoulin
Copy link
Author

clementmoulin commented May 24, 2021

Bonjour @williamdes

The script is basically this:

  require_once('config.inc.php');
  $_SESSION['PMA_single_signon_user'] = $username;
  $_SESSION['PMA_single_signon_password'] = $password;
  isset($cfg['Servers'][$id]) || die('BAD REQUEST');
  $_SESSION['PMA_single_signon_cfgupdate'] = $cfg['Servers'][$id];
  header('Location: index.php');

And yes, I'm speaking about "configuration storage / Zero configuration" feature.

@williamdes
Copy link
Member

Bonjour @clementmoulin

Thank you for your script, this will help
Could you give the config.inc.php file for one of the non working servers just so I can see the values your configured for configuration storage please ?

@williamdes williamdes moved this from Needs a second check to be a bug to waiting... in Questions May 28, 2021
@clementmoulin
Copy link
Author

Here is the config.inc.php we are using: Downloads.zip

@williamdes williamdes moved this from waiting... to Needs a second check to be a bug in Questions Jun 1, 2021
@williamdes williamdes added this to the 5.1.2 milestone Jun 26, 2021
@williamdes
Copy link
Member

Hi @clementmoulin

I am sorry about the delay it takes to be processed, this is on my TODO list and I will let you know when I can test this
Thank you for the configs

@williamdes williamdes self-assigned this Aug 22, 2021
@williamdes williamdes added Bug A problem or regression with an existing feature and removed question Used when we need feedback from the submitter or when the issue is a question about PMA labels Aug 22, 2021
@williamdes williamdes removed this from Needs a second check to be a bug in Questions Aug 22, 2021
@williamdes williamdes added this to Needs triage in issues via automation Aug 22, 2021
@williamdes
Copy link
Member

Hi @clementmoulin

After a bit of research I was able to re-build your setup

This is my SSO page

<?php

/* Use cookies for session */
ini_set('session.use_cookies', 'true');
/* Change this to true if using phpMyAdmin over https */
$secure_cookie = true;
/* Need to have cookie visible from parent directory */
session_set_cookie_params(0, '/', '', $secure_cookie, true);
/* Create signon session */
$session_name = 'sso-sr-phm';
session_name($session_name);
// Uncomment and change the following line to match your $cfg['SessionSavePath']
//session_save_path('/foobar');
session_start();

$id = 1;
$username = 'public';
$password = 'public';

print_r($_SESSION['PMA_single_signon_error_message'] ?? 'n/a');
require_once('/mnt/Dev/pma/phpMyAdmin-5.1.2-dev-all-languages/config.inc.php');
  $_SESSION['PMA_single_signon_user'] = $username;
  $_SESSION['PMA_single_signon_password'] = $password;
  isset($cfg['Servers'][$id]) || die('BAD REQUEST');
  $_SESSION['PMA_single_signon_cfgupdate'] = $cfg['Servers'][$id];
  session_write_close();
?>
<a href="/pma/phpMyAdmin-5.1.2-dev-all-languages">PMA</a>

When I try to fix the phpMyAdmin tables I have #1046 - Aucune base n'a été sélectionnée
Do you also have this error ?

@williamdes williamdes moved this from Needs triage to to be fixed soon in issues Aug 24, 2021
@clementmoulin
Copy link
Author

Hi @williamdes

I don't have a option to "fix" (or maybe I didn't find it).

On the homepage I get:

Le stockage de configurations phpMyAdmin n'est pas complètement configuré, certaines fonctionnalités ont été désactivées. Voir l'analyse du problème.
Ou encore aller sur l'onglet « Opérations » de n'importe quelle base de données pour le définir à cet endroit.

And when I go to the "Analysis":

$cfg['Servers'][$i]['pmadb'] ... | OK
$cfg['Servers'][$i]['relation'] ... | en erreur
Fonctions relationnelles: Désactivé
[...]

 

@williamdes
Copy link
Member

Hi @clementmoulin
Thank you, could you post a screenshot of the Analysis page ?

Normally there is a fix link on top and it does not work in my testing
If you can help confirm this please ?

@clementmoulin
Copy link
Author

My bad :/

There is indeed an alert box with a "fix" link !
I clicked on it, and got the same message as you "#1046 - Aucune base n'a été sélectionnée".

williamdes added a commit that referenced this issue Aug 27, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Aug 27, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Aug 27, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Aug 27, 2021
…e than "phpmyadmin"

Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes
Copy link
Member

FYI I did push cdb027c
It might help you create storage databases, I saw your config was stuck on "phpmyadmin" as a db name, probably for this reason

williamdes added a commit that referenced this issue Aug 28, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Aug 28, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Aug 28, 2021
…eating the storage tables

Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Aug 28, 2021
… canAccessStorageTable function

Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes
Copy link
Member

williamdes commented Aug 28, 2021

Hi @clementmoulin

After fixing edge case after edge case I have no covered what you reported.
Could you try the latest 5.1 version in development (phpMyAdmin 5.1+snapshot) and let me know how it works for you ?

(yes, at the time writing this there is still one non perfect thing: when you click on create tables, you need a second click to get a full green table list even If I am quite sure this is only a GUI thing to fix)

williamdes added a commit that referenced this issue Aug 30, 2021
Before this fix you needed to click twice on create tables to see a full list of green checks.
As part of the values where fetched by a global and the feature list values by this $cfgRelation passed as a parameter.

This was visible when the pmadb existed but had no tables in it.

Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes williamdes moved this from to be fixed soon to Reproduced in issues Aug 30, 2021
williamdes added a commit that referenced this issue Aug 30, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from Reproduced to Closed Aug 30, 2021
@williamdes
Copy link
Member

Everything should be fixed, please let me know if that fits your setup using the latest snapshot :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature
Projects
issues
  
Closed
Development

No branches or pull requests

2 participants