Using Auto Authentication

Auto authentication allows you to automatically authenticate users.

Steps to enable Auto Authentication


Customizing the remoteAutoAuth function

In your installation there is a folder admin/lib/custom. Within that folder is a file called remote_auth.php. This file contains the _remoteAutoAuth function. Customize this function to get the current user's credentials.

On success, the function remoteAutoAuth should return an associative array with keys (username, password) for the user.  For example: array('username'=>'John', 'password'=>'Test').

Here is a simple example of the function customized using HTTP authentication:

function remoteAutoAuth() {
    
    $user = false;
    
    if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
         $user = array();
         $user['username'] = $_SERVER['PHP_AUTH_USER'];
         $user['password'] = $_SERVER['PHP_AUTH_PW'];
    } 		     

    return $user; 
}


Debugging auto-remote authentication

You can debug auto-authentication by setting KB_AUTH_AUTO = 2, which allows you to continually try relogging in so that you can fix any problems without having to start over every time. Important: Don't forget to reset this back to 1 (or 0) when you have finished debugging.



Article ID: 375
Last updated: 16 Nov, 2013
Revision: 1
User Manual v7.0 -> Single Sign On -> Remote Authentication -> Using Auto Authentication
https://www.kbpublisher.com/kb/using-auto-authentication_375.html