PHP code example of aleszatloukal / active-directory
1. Go to this page and download the library: Download aleszatloukal/active-directory library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
aleszatloukal / active-directory example snippets
php
$ad = new \Magium\ActiveDirectory\ActiveDirectory(
$configuration, // shown later
$psr7CompatibleRequest
);
$entity = $ad->authenticate();
php
$ad->forget();
php
echo $entity->getName() . '<Br />'; // The user's name
echo $entity->getOid() . '<Br />'; //The user's AD object ID, useful for mapping to a local user obhect
echo $entity->getPreferredUsername() . '<Br />'; // The user's username, usually an email address.