/jumpcloud

Simple Library to Authenicate & more via Jumpclouds REST API

Primary LanguagePHPMIT LicenseMIT

jumpcloud

Jumpcloud API

Master

Build Status Scrutinizer Code Quality Build Status SensioLabsInsight Code Coverage

Develop

Scrutinizer Code Quality Build Status Code Coverage

Authorization API

http://support.jumpcloud.com/knowledgebase/articles/455570

API

https://github.com/TheJumpCloud/JumpCloudAPI

Examples

<?php

require __DIR__ . '/../vendor/autoload.php';

use Jumpcloud\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';
}