You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Justin René Back 253e9cde83 Merge branch 'master' of https://git.justinback.com/PixelcatProductions/JBAuth 10 months ago
class Updated to new response scheme 10 months ago
docs Updated Docs 1 year ago
examples Updated to new response scheme 10 months ago
nbproject Updated to new response scheme 10 months ago
.gitignore Initial commit 1 year ago
LICENSE Initial commit 1 year ago
README.md Update 'README.md' 1 year ago
composer.json updated composer 1 year ago

README.md

JBAuth

Installation

composer require justinback/jbauth:dev-master

Example

<?php
session_start();

include 'vendor/autoload.php';

$JBAuth = new \justinback\JBAuth("CLIENT_ID", "CLIENT_SECRET", "SCOPES AS SEPERATED LIST", "APIKEY");

if(!isset($_GET["code"])){

$CSRF = $JBAuth->authorize();
$_SESSION["RANDOM_CSRF_IDENTIFIER_TEST"] = $CSRF;
}

try {

if($_SESSION["RANDOM_CSRF_IDENTIFIER_TEST"] != $_GET["state"]){
    die("CSRF Mismatch!");
}

$Token = $JBAuth->token($_GET["code"]);
var_dump($Token);
echo "<br><br>";
$User = $JBAuth->user($Token->access_token);
var_dump($User);

} catch (Exception $ex){
    echo $ex;
}