Using Remote Authentication

Remote authentication allows you to integrate your organization's authentication system with KBPublisher.

Before you start:

Steps to enable Remote Authentication​

Quick summary of the process

KBPublisher public view

Customizing the remoteDoAuth 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 _remoteDoAuth function. Customize this function to do authentication against your internal system by using the username and password provided.

Here is a simple example of the function customized to authenticate against a MySQL database:

function remoteDoAuth($username, $password) {

    $user = false;
    $db = &DBUtil::connect($conf);

    $sql = "SELECT 1 FROM ss_user WHERE username = '%s' AND password = '%s'";
    $sql = sprintf($sql, $username, $password);
    $result = &$db->Execute($sql) or die(db_error($sql, false, $db));

    // if found
    if($result->RecordCount() == 1) {
        $user = 1; // assign a user id, this user id should exists in kb user table

    return $user;

 Also see examples in attached files.

Tracking logins

You can see how your remote authentication works in logs Logs/Logins

For debugging every last login is logged to a file called last_remote_login.log in the KBPublisher cache directory (APP_CACHE_DIR in admin/ ).
For example: /home/username/ kb_cache/last_remote_login.log

Article ID: 379
Last updated: 05 May, 2021
Revision: 6
User Manual v7.0 -> Single Sign On -> Remote Authentication -> Using Remote Authentication