Download the PHP package jdelaune/oauth2-client-bundle without Composer
On this page you can find all versions of the php package jdelaune/oauth2-client-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jdelaune/oauth2-client-bundle
More information about jdelaune/oauth2-client-bundle
Files in jdelaune/oauth2-client-bundle
Package oauth2-client-bundle
Short Description Symfony OAuth2ClientBundle
License MIT
Homepage http://github.com/jdelaune/oauth2-client-bundle
Informations about the package oauth2-client-bundle
OAuth2 Client Bundle
OAuth2 Client Bundle for Symfony 2-5.
Overview
Allow for the protection of resources via OAuth2. Provides two Symfony firewalls. One for checking bearer access tokens for securing API application. The access tokens can be provided via a header (recommended) or query e.g. Authorization: Bearer {Access Token}
or http://example.com/resource?access_token={Access Token}
. The other firewall is for securing web applications via the authorization code grant type.
Installation
Step 1: Add package to Composer
Add the bundle to your composer.json:
Now tell composer to download the bundle by running the command:
Composer will install the bundle to your project's vendor/jdelaune
directory.
Step 2: Enable the bundle
Enable the bundle in the kernel:
Step 3: Add parameters
You'll need add your OAuth2 Server URIs as parameters to your parameters.yml
The verify uri should verify the access token on your OAuth2 Server and provide a JSON encoded array of:
access_token
client_id
expires_in
user_id
(Optional)scope
(Optional)
Step 4a: Configure security (access token)
Access token only firewall is most often used for securing APIs where the end user won't actually be interacting with your Symfony application directly.
You'll need to setup a firewall in your security.yml
Step 4b: Configure security (authorization code)
Authorization code firewall is most often used when the end user is interacting with your Symfony application.
You'll need to setup a firewall in your security.yml
The redirect_uri
needs to be a URI behind the same firewall. You can use all the usual configuration options here as well that one would use for the form firewall like use_referer
and default_target_path
.
Step 5: Add routing
We provide default routing for some paths needed when using the authorization code firewall. Add this to your routing.yml
The OAuth2Token
The client bundle will provide an OAuth2Token
object for any secured path in your controllers.
There are additional getters available on the OAuth2User
object:
The OAuth2User
The client bundle will provide an OAuth2User
object for any secured path in your controllers.
Scopes will be turned into roles automatically, e.g. a scope of email
would result in a role of ROLE_EMAIL
.
There are additional getters available on the OAuth2User
object:
All versions of oauth2-client-bundle with dependencies
guzzlehttp/guzzle Version ^6.0
symfony/framework-bundle Version ^3.0 || ^4.0 || ^5.0
symfony/security-bundle Version ^3.0 || ^4.0 || ^5.0
sensio/framework-extra-bundle Version ^5.1