Loading...

Staff ad_authenticate

Request Description

Checks supplied username and password pair against active directory server. If the username and password matches a valid account, useful records are returned back including any fields entered through the fields parameter.

Username and password combinations should never be stored in source.


Request Information

Response Format:JSON
Requires Authentication:No
Cached:No
Cache Duration:N/A

Parameters

usernameValid active directory username used to do the check on
passwordValid active directory password for supplied username
domainDomain used at the school
serverEither IP or FQDN of the server used to do the checking against
fields
Optional
Array containing additional Active Directory field names to return with a valid user account.
Eg: physicaldeliveryofficename for "Office"

Example Request

$a = $api->sendRequest(
  array( 
    'controller'      => 'Staff',  
    'action'          => 'ad_authenticate',
    'username'        => 'TestUsername',
    'password'        => 'TestPassword',
    'domain'          => 'school.local',
    'server'          => '10.60.12.4',
    'fields'          => array( 'physicaldeliveryofficename' )
  );

Example Result

Array
(
    [result] => Success
    [data] => Array
        (
            [USERNAME] => TestUser
            [DESC] => Teacher of English
            [physicaldeliveryofficename] => 113
            [DISPLAY_NAME] => Jimmy Walker
            [HOME_DIR] => \\staff\users\TestUser
            [EMAIL] => testuser@nationalce-ac.org.uk
            [GROUPS] => Array
                (
                    [0] => Papercut
                    [1] => Users
                    [2] => Staff
                    [3] => English
                )

        )

)