aciliainternet / oauth-authorization-bundle
Acilia Authorization Bundle
Installs: 5 548
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 25
Forks: 4
Open Issues: 0
Type:bundle
Requires
- php: >=5.3.3
- guzzlehttp/guzzle: ^6.2
- symfony/framework-bundle: >=2.8.0
README
Acilia oAuth authentication and authroization Bundle for Symfony2/3
OauthAuthorizationBundle
Symfony2 and Symfony3 Oauth Authorization bundle developed by Acilia Internet
This bundle allows to authenticate and get authrozation against Oauth2 API service and creates a UserProviderInterface
Installation and configuration:
Pretty simple with Composer, run:
composer require aciliainternet/oauth-authorization-bundle
Add OauthAuthorizationBundle to your application kernel
// app/AppKernel.php public function registerBundles() { return array( // ... new Acilia\Bundle\OauthAuthorizationBundle\AciliaOauthAuthorizationBundle(), // ... ); }
Configuration example
This bundle provides a basic security.yml, you can import from your security.yml file
imports:
- { resource: "@AciliaOauthAuthorizationBundle/Resources/config/security.yml" }
You must configure some parameters
acilia_oauth_authorization: access_url: 'http://api.my-oauth2.com' # url of the oauth api enabled: true # enable or disable authentication, if false users as authenticated as 'anon.' oauth_secret: '_secret_hash_' # hash for encrypt requests to the api client_id: 'my_app_identifier_key' # unique identifier for the application excludes: ['www.domain-excluded.com'] # array of domains to exclude from the auth checking
Finally, you'll need to define the logout path. Add to your routing.yml file the following:
logout:
path: /logout