free2er / oauth-server-bundle
OAuth Server Bundle
1.0.0
2019-04-11 22:45 UTC
Requires
- php: ^7.1
- doctrine/doctrine-bundle: ^1.6
- doctrine/orm: ^2.5
- league/oauth2-server: ^7.3
- nesbot/carbon: ^2.16
- nyholm/psr7: ^1.1
- symfony/config: ^4.2
- symfony/console: ^4.2
- symfony/dependency-injection: ^4.2
- symfony/http-kernel: ^4.2
- symfony/psr-http-message-bridge: ^1.2
Requires (Dev)
- free2er/coding-standard: ^1.0
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2024-11-12 11:46:11 UTC
README
Symfony bundle which provides OAuth 2.0 authorization server capabilities. The authorization server implemented using the thephpleague/oauth2-server library.
Installation
This component can be installed with the Composer dependency manager.
-
Install the component as a dependency of your project
composer require free2er/oauth-server-bundle
-
Enable the bundle
<?php // config/bundles.php return [ // ... Free2er\OAuth\OAuthServerBundle::class => ['all' => true], // ... ];
- Configure the bundle parameters
# config/packages/oauth_server.yaml o_auth_server: encryption_key: '%env(resolve:APP_SECRET)%' private_key: file://%kernel.project_dir%/path/to/private.key private_key_password: ~ ttl: access_token: PT1H authorization_code: PT1H refresh_token: P1M grants: - League\OAuth2\Server\Grant\ClientCredentialsGrant - League\OAuth2\Server\Grant\PasswordGrant - League\OAuth2\Server\Grant\AuthCodeGrant - League\OAuth2\Server\Grant\RefreshTokenGrant
- Configure the router
# config/routes.yaml # ... oauth: resource: '@OAuthServerBundle/Resources/config/routes.yaml' prefix: /auth # ...
-
Update the project schema and register the client application
bin/console doctrine:schema:update bin/console oauth:client:update my-client -g client_credentials
-
Done!