Authenticate Endpoint

1. Connect

connect (String username, String password)
connect (String sourceId, String username, String password) (since 7.0)

Parameters

  • username The unique username for this account
  • password The unique password for this account
  • sourceId The sourceId of the LDAP or AD source. Use getLdapSources() to return a list of all known authentication servers. If using PHP or a language that does not like method overloading use “-1” as the sourceId to simulate null.

Description

This function logs you into the system. You must be logged in before you can call most other functions.

To get the value of the ‘success’ field, use: .get(“success”);
For the value of the ‘message’ field, use: .get(“message”);

The value returned in the ‘success’ field will be a string representation of a boolean (‘true or false’) indicating whether or not the login attempt was successful.

The value returned in the ‘message’ field will be a text message that explains the response. If the login attempt fails for any reason (i.e. the ‘success’ field is ‘false’), the ‘message’ field will explain why the failure occurred.

Example

$baseService = "http://www.myhost.com/Service/WebObjects/Service.woa/ws/";
$objClient = new SoapClient($baseService . "Authenticate?wsdl", array('trace' => true));

$results = $objClient->connect($username, $password);

//This will return an Associative Array
$success = $results['success'];
if ($success=="false") {
    echo $results['message'] . "\n";
    exit();
}
echo "Login Successful\n";

All web services calls, including Connect, observe the session time out constraints defined at the container and application levels. In order to maintain the session flags, the ‘maintainSession’ flag must be set to true on the org.apache.axis.client.Service object using the service. If managing session state manually, the http headers must be preserved for all subsequent interactions. Failure to maintain the headers will result in errors stating that the current session is not logged in.

2. Disconnect

disconnect()

Description

This function logs you out of the system. The ‘disconnect’ function returns a HashMap
containing two fields: ‘success’ and ‘message’.

The value returned in the ‘success’ field will be a string representation of a boolean (‘true’ or ‘false’) indicating whether or not the attempt to log out was successful.

The value returned in the ‘message’ field will be a text message that explains the response. If the request fails for any reason (i.e. the ‘success’ field is ‘false’), the ‘message’ field will explain why the failure occurred. Otherwise, you will see the words ‘Logged Out.’

Example

function logout() {
    global $objClient;
    global $baseService;

    $objClient->SoapClient($baseService . "Authenticate?wsdl", array('trace' => true));

    $results = $objClient->disconnect();
    //This will return an Associative Array
    $success = $results['success'];
    if ($success=="false") {
        echo $results['message'] . "\n";
        exit();
    }
    echo "Logout Successful\n";
    exit();
}

3. GETLDAPSOURCES

getLdapSources() (since 7.0)

Parameters

None

Description

This function returns a list of all available LDAP sources when using the multi-source LDAP authentication.