gsdevme/jumpcloud

Simple library to authenicate with Jumpclouds REST Authorization API.

1.5.0 2016-08-01 19:14 UTC

This package is not auto-updated.

Last update: 2020-03-29 15:39:09 UTC


README

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';
}