For purposes of getting started, we'll use the Apache htpasswd system for
maintaining usernames and passwords.
$ htpasswd -c -s /home/username/htpasswd.conf username
New password:
Re-type new password:
Adding password for user username
Solar needs to know what kind of authentication we're using; edit the Solar config file to provide this information.
$ mate Solar.config.php
<?php
$config = array();
// Front controller HREF prefix
$config['Solar_Uri_Action']['path'] = '/index.php';
// Public directory HREF prefix
$config['Solar_Uri_Public']['path'] = '/public';
// Authentication source
$config['Solar_Auth'] = array(
'adapter' => 'Solar_Auth_Adapter_Htpasswd',
);
// Adapter information
$config['Solar_Auth_Adapter_Htpasswd'] = array(
'file' => '/home/username/htpasswd.conf',
);
// Done!
return $config;
?>
http://127.0.0.1/index.php/hello-app
(The "app" version of "Hello World!" includes localization and authentication, making more like a real application.)
Attempt to log in with your username and password.
See the Solar_Auth package for the list of supported authentication sources.