https://github.com/clearcodehq/eh-library-auth
https://github.com/clearcodehq/eh-library-auth
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/clearcodehq/eh-library-auth
- Owner: ClearcodeHQ
- License: mit
- Created: 2015-12-14T14:56:44.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-14T08:38:20.000Z (over 10 years ago)
- Last Synced: 2025-03-30T13:37:08.173Z (about 1 year ago)
- Language: PHP
- Size: 14.6 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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');
```