Basic HTTP Authentication Monitoring

Monitive allows you to monitor web application behind authenticated sections. The most simple authentication is the Basic HTTP Auth, supported by the HTTP protocol since very many years ago.

Authentication can be easily implemented either by editing the corresponding .htaccess file, Apache’s configuration files or straight from your programming language, to dynamically check or request authentication. In PHP, this is accomplished using a simple code such as:

<?php
if (!isset($_SERVER['PHP_AUTH_USER'])) {
    header('WWW-Authenticate: Basic realm="My Realm"');
    header('HTTP/1.0 401 Unauthorized');
    echo 'Text to send if user hits Cancel button';
    exit;
} else {
    echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
    echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as 
         your password.</p>";
}
?>

This makes the browser display an authentication window if the user is not already authenticated:

HTTP-auth

If your application is behind this type of authentication, you can monitor it using Monitive’s HTTP Basic Auth feature. Edit your HTTP alert, open Advanced / custom settings and fill in the Basic Auth username and Basic Auth password fields with a test account credentials.

Uptime Monitoring Basic HTTP Auth check

Uptime monitoring will now login to your application every minute (or every few minutes) and instantly alert you if something’s wrong with the application, for example if it suddenly starts to display a 500 Internal Server error page or any other error code. To make sure it runs at top notch, you can set the custom timeout to 5 seconds, so if it gets crowded and it starts to put users on hold, you’ll get a notice.

Didn't find what you're looking for?

Search our knowledge base or use the form below