https://github.com/krakphp/lava-oauth2
Lava OAuth2 Integration
https://github.com/krakphp/lava-oauth2
Last synced: about 1 year ago
JSON representation
Lava OAuth2 Integration
- Host: GitHub
- URL: https://github.com/krakphp/lava-oauth2
- Owner: krakphp
- License: mit
- Created: 2017-05-04T03:57:05.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-04T05:38:49.000Z (about 9 years ago)
- Last Synced: 2025-01-29T06:52:25.072Z (over 1 year ago)
- Language: PHP
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Lava OAuth2
This library provides OAuth2 integration with the Krak\\Lava framework. It uses the `league/oauth2-server` package for all of the heavy lifting and the Doctrine ORM for the backend.
## Installation
Install with composer at `krak/lava-oauth2`
## Usage
```php
with(new LavaOAuth2\OAuth2Package());
$app['krak.lava_oauth2']['private_key'] = $app->basePath('oauth-private.key');
$app['krak.lava_oauth2']['public_key'] = $app->basePath('oauth-public.key');
$app['krak.lava_oauth2']['grants'] = [
'client_credentials' => true,
'access_token_ttl' => new \DateInterval('PT2H'),
];
$app->httpStack()->push($app['krak.lava_oauth2']['resource_server_middleware']);
$app->httpStack()->push(mount('/oauth', $app['krak.lava_oauth2']));
```
This configures the lava_oauth2 application and adds the oauth2 server and middleware onto the main application.