Skip Navigation
Expand
What is Agent Authenticator?
Answer ID 6573   |   Last Review Date 03/12/2019

What is Agent Authenticator?

Environment:

Agent Authenticator

Resolution:

When Connect PHP API receives a request, access control measures are enforced. First, Oracle RightNow CX configuration is checked to ensure the API has been enabled at a site level. Second, the user credentials supplied in the applicable authentication function are validated.

Authenticating with Connect PHP API is slightly different based on the access point you are using. When using the process designer and analytics access points, authentication is automatically initiated by the Oracle RightNow CX platform, whereas the file manager access point must be authenticated by calling the AgentAuthenticator.phph script and the customer portal access point must be authenticated by calling the Connect_init.php script. This is done behind the scenes for CP. For further information see

Answer ID 10050: Using Connect_init.php in Customer Portal

The reason that authentication scripts must be called for both the file manager and the customer portal access points is because they contain customer-facing pages that cannot be automatically authenticated by the Oracle RightNow CX platform. The standardized libraries protect custom PHP pages from unauthorized use, improving the security of customer sites and reducing the overall cost of site upgrades.


There are several methods available including AgentAuthenticator::authenticateSessionID. The following example code illustrates the use of this method:

try {
    if (!defined('DOCROOT')) {
        $docroot = get_cfg_var('doc_root');
        define('DOCROOT', $docroot);
    }

    /************* Agent Authentication ***************/
    // Set up and call the AgentAuthenticator
    require_once (DOCROOT . '/include/services/AgentAuthenticator.phph');
    $user='username';
    $pass='password';
    $account =AgentAuthenticator::authenticateCredentials($user,$pass);
    if (!isset($account)) {
        throw new \Exception("Could not authenticate agent using credentials");
    }
} catch(Exception $ex) {
    echo $ex->getMessage();
    exit;
} catch(RNCPHP\ConnectAPIError $ex) {
    echo $ex->getMessage();
    exit;
}


 

For more information, please see the Developer Guide for Oracle RightNow Connect PHP API Cloud Service, located here: Answer ID 5169: Technical Documentation and Sample Code

Notify Me
The page will refresh upon submission. Any pending input will be lost.