An open API service indexing awesome lists of open source software.

https://github.com/clearcodehq/eh-library-auth


https://github.com/clearcodehq/eh-library-auth

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

## Features
- register user
- authenticate JWT
- generate JWT
- get user

see [LibraryAuth](https://github.com/ClearcodeHQ/eh-library-auth/blob/master/src/LibraryAuth.php) class

## Usage

use Application class that implements LibraryAuth features

```php

use Clearcode\EHLibraryAuth\Application;

$app = new Application();

$app->registerUser('johndoe@example.com', ['reader']);

$token = $app->generateToken('johndoe@example.com');

$app->authenticate($token);

$user = $app->getUser('johndoe@example.com');

```