Slim/Secure admin interface

From Aimeos documentation

Slim
Other languages:
English 100%

The Aimeos package for the Slim PHP framework also contains an administration interface for managing products and other content. It's instantly available after you've set up the Slim environment for Aimeos.

It's important to protect the administration interface with a password or some other kind of authentication!

If the internal PHP web server (php -S 127.0.0.1:8000 -t public) is still running, you can find it at:

http://127.0.0.1:8000/admin

The easiest way is to add HTTP basic authentication (the browser is asking for user name and password) to all /admin URLs. In Slim, there's a middleware which you can add to your application. To install it, execute

composer require tuupola/slim-basic-auth

on the command line in your application directory. Afterwards, adapt your public/index.php file and add these lines before $app->run():

  1. $app->add(new \Slim\Middleware\HttpBasicAuthentication([
  2.     "realm" => "Aimeos administration",
  3.     "path" => "/admin",
  4.     "users" => [
  5.         "admin" => "secret",
  6.     ],
  7. ]));

The "users" array can contain a list of user name / password combinations and you need to use a really secret password!


<< Previous: Setup the Slim environment | Next: Configure cronjobs >>