Download the PHP package reb3r/oauth2-server-httpfoundation-bridge without Composer
On this page you can find all versions of the php package reb3r/oauth2-server-httpfoundation-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download reb3r/oauth2-server-httpfoundation-bridge
More information about reb3r/oauth2-server-httpfoundation-bridge
Files in reb3r/oauth2-server-httpfoundation-bridge
Package oauth2-server-httpfoundation-bridge
Short Description A bridge to HttpFoundation for oauth2-server-php
License MIT
Homepage http://github.com/bshaffer/oauth2-server-httpfoundation-bridge
Informations about the package oauth2-server-httpfoundation-bridge
oauth2-server-httpfoundation-bridge
A bridge to HttpFoundation for oauth2-server-php.
oauth2-server-httpfoundation-bridge is a wrapper for oauth2-server-php
which returns Symfony\Component\HttpFoundation\Response instead of OAuth2\Response, and uses Symfony\Component\HttpFoundation\Request instead of OAuth2\Request.
If you are integrating OAuth2 into a Silex, Symfony, or Laravel app, (or any app using HttpFoundation), this will make your application much cleaner
Installation
Composer is the best way to install this library. Add this line to composer.json:
And then run composer.phar install
Match tags with the oauth2-server-php library when possible.
v2.2is the latest tag.
Creating the request
Creating the request object is the same as before, except now you use the
OAuth2\HttpFoundationBridge\Request class:
The Request object is now compatible with both HttpFoundation and oauth2-server-php
If the HttpFoundation request already exists, you can use the static createFromRequest
function to build the OAuth2\HttpFoundationBridge\Request instance:
Creating the response
The OAuth2\HttpFoundationBridge\Response object extends Symfony\Component\HttpFoundation\JsonResponse,
and implements OAuth2\ResponseInterface, allowing you to pass this in and return it from your controllers.
In Symfony and Silex, this will be all that is needed to integrate the server:
Note: this object will return JSON. Implement your own class using
OAuth2\ResponseInterfaceto support a different content-type.
Examples
- OAuth2 Request - Silex Integration
- OAuth2 Response - Silex Integration
Contact
Please contact Christian Reber (christian.reber
Acknowledgements
Very big "Thank you" goes to Brent Shaffer (https://github.com/bshaffer) for the original version which I forked.
All versions of oauth2-server-httpfoundation-bridge with dependencies
symfony/http-foundation Version ^5.4||^6.0||^7.0||^8.0
reb3r/oauth2-server-php Version >=0.9