Databases Reference
In-Depth Information
Let us suppose that the authenticating application has used a session named
FirstApp to store the credentials. We tell this to phpMyAdmin by adding the
following line of code:
$cfg['Servers'][$i]['SignonSession'] = 'FirstApp';
We must take care of users that would try to access phpMyAdmin before the other
application; in this case, phpMyAdmin will redirect users to the authenticating
application. This is done with:
$cfg['Servers'][$i]['SignonURL'] = 'http://www.mydomain.com/FirstApp';
How does the authenticating application store credentials in a format that
phpMyAdmin can understand? An example is included as scripts/signon.php .
In this script, there is a simple HTML form to input the credentials and logic that
initializes the session—we would use FirstApp as a session name, and create the
user, password, host, and port information into this session, shown as follows:
$_SESSION['PMA_single_signon_user'] = $_POST['user'];
$_SESSION['PMA_single_signon_password'] = $_POST['password'];
$_SESSION['PMA_single_signon_host'] = $_POST['host'];
$_SESSION['PMA_single_signon_port'] = $_POST['port'];
Note that the authenticating first application does not need to ask the
MySQL's credentials to the user. These could be hard coded inside
the application, as they are secret or there is a known correspondence
between the credentials of this application and that of MySQL's.
To pass additional configuration parameters to the signon module,
$_SESSION['PMA_single_signon_cfgupdate'] can receive an array containing
any additional server parameters that are permitted in $cfg['Servers'][$i] .
The authenticating application then uses a way of its choosing—a link or a button—
to let its users start phpMyAdmin. If an error happens during the login (for example,
a denied access), the signon module saves into $_SESSION['PMA_single_signon_
error_message'] the appropriate error message.
In another example, scripts/openid.php shows how to log in using the popular
OpenID mechanism.
 
Search WWH ::




Custom Search