==================== User Authentication ==================== -------------------------------------- Set up a minimal authentication source -------------------------------------- For purposes of getting started, we'll use the Apache `htpasswd` system for maintaining usernames and passwords. {{code: bash $ htpasswd -c -s /home/username/htpasswd.conf username New password: Re-type new password: Adding password for user username }} --------------------- Edit Solar.config.php --------------------- Solar needs to know what kind of authentication we're using; edit the Solar config file to provide this information. {{code: bash $ mate Solar.config.php }} {{code: 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; }} --------------------- Browse to "Hello-App" --------------------- 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. ---------------------------- Other authentication sources ---------------------------- See the [[Package::Solar_Auth | ]] package for the list of supported authentication sources.