What options are available to secure a Drupal site using HTTP authentication?

How can I implement HTTP authentication for a Drupal-based web application to restrict access, for example. only for developers?

+4
source share
3 answers
$LoginSuccessful = false; if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])){ $Username = $_SERVER['PHP_AUTH_USER']; $Password = $_SERVER['PHP_AUTH_PW']; if ($Username == 'username_test' && $Password == 'password_test'){ $LoginSuccessful = true; } } // Login passed successful? if (!$LoginSuccessful){ header('WWW-Authenticate: Basic realm="Secret page"'); header('HTTP/1.0 401 Unauthorized'); print "Login failed!\n"; exit(); } 

Solved my problem .. thnks ...

+1
source

We allow .htpasswd to provide a login invitation.

You can also use this if you want a module:

http://drupal.org/project/securesite

+2
source

If Apache htaccess is enough for you, read here .

0
source

All Articles