Automatic user login in PHPMyAdmin

I am writing a web hosting control panel for our organization and want to be able to automatically enter the user into the system for phpMyAdmin.

  • The user logs out of the control panel.
  • User clicks "Database Management"
  • The user is redirected to PHPMyAdmin and automatically logs in.

What would be the best way to do this?

Of course, we do not want to save the passwords of the account of the control panel of our users in our database in the form of plain text.

+4
source share
4 answers

, , . , phpMyAdmin - , .

, phpMyAdmin . . cookie, . phpMyAdmin Blowfish , .

, , phpMyAdmin, . http://wiki.phpmyadmin.net/pma/Auth_types .

auth_type signon - , phpMyAdmin (SSO). phpMyAdmin, MySQL , , , , phpMyAdmin, .

, . foo SSO foo_mysql. foo_mysql () . phpMyAdmin , "signon" auth, http://wiki.phpmyadmin.net/pma/Auth_types#signon.

( ) , SSO , . , foo_4f65ca1d , phpMyAdmin . phpMyAdmin.

phpMyAdmin, phpMyAdmin, phpMyAdmin. , . , (, phpMyAdmin).

, . , .

, , .

+2

.

\ PHPMYADMIN\config.inc.php

$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'Server Username';
$cfg['Servers'][$i]['password'] = 'Server Password';

. root.

. localhost.

MySQL . phpMyAdmin.

+1

, , "" - ? , MyAdmin php-. php, vars, , โ€‹โ€‹ user, passwd .., MyAdmin. , : php

Edit: phpMyAdmin seems to have code for single sign-on, so you only need to set the root file values โ€‹โ€‹in the control panel. Take a look at: http://wiki.phpmyadmin.net/pma/Auth_types#signon

0
source

I think this is the solution to your problem.

Add the lines before the first for the statement in config.inc.php:

$cfg['Servers'][1]['auth_type'] = 'config';
$cfg['Servers'][1]['host'] = 'localhost'; //edit if you have db in the other host
$cfg['Servers'][1]['connect_type'] = 'tcp';
$cfg['Servers'][1]['compress'] = false;
$cfg['Servers'][1]['extension'] = 'mysql';
$cfg['Servers'][1]['user'] = 'root'; //edit this line
$cfg['Servers'][1]['password'] = ''; // edit this line

This will help.

-2
source

Source: https://habr.com/ru/post/1546290/


All Articles