PHP code example of gsdevme / jumpcloud

1. Go to this page and download the library: Download gsdevme/jumpcloud 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/ */

    

gsdevme / jumpcloud example snippets




umpcloud\Model\JumpcloudCredentials;
use Jumpcloud\Request\IsAuthenticatedRequest;
use Gsdev\Fabric\Bridge\Guzzle\GuzzleClient;
use Jumpcloud\Response\IsAuthenticatedResponse;

$client = new GuzzleClient();

$credentials = new JumpcloudCredentials(getenv('JUMPCLOUD_API_KEY'));

$request = new IsAuthenticatedRequest($credentials, 'username', 'password1234');

$response = $client->send($request);

if ($response instanceof IsAuthenticatedResponse && $response->isAuthenticated()) {
    echo 'Authenticated';
} else {
    echo 'Not Authenticated';
}