Download the PHP package jvandemo/zendservice-oauth2 without Composer
On this page you can find all versions of the php package jvandemo/zendservice-oauth2. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package zendservice-oauth2
ZendService_Oauth2
Oauth2 service for Zend Framework 2
Status
Currently under development so please don't use in production environments yet...
To do
- Write more and better documentation
- Provide more unit tests
Composer
ZendService_Oauth2 is now available as composer package on https://packagist.org/packages/jvandemo/zendservice-oauth2
To include it in your project, add the following line to your composer.json
:
Live demo
There is a live demo available at http://jvandemo.my.phpcloud.com/ZendService_Oauth2/demos/ZendService/Oauth2/AuthorizationCode/index.php
The source of the demo page is included in the demos
folder.
A quick demo
Example code using the default Authorization Code grant:
The third party authorization server will redirect you to the url you specified in redirect_uri
:
The access token is a very lightweight object that can be stored in a session or serialized in your backend system for later use, so you don't have to repeat the previous steps if not necessary.
Then, whenever you need to perform an Oauth2.0 request:
By default, the Zend\Http\Client
is used to perform the requests, so you get a 'Zend\Http\Response' obejct:
Main features
- Provides a main
ZendService\Oauth2\Client\Client
class to interact with for ease of use - Works out of the box with the following default configuration:
- Uses
AuthorizationCode
as the default AuthorizationGrant - Uses
Zend\Http\Client
as the default Http client - Uses
ZendService\Oauth2\AccessToken\AccessToken
as the default AccessToken object - Uses
ZendService\Oauth2\Client\Client
as the default client implementation
- Uses
- Supports custom client implementation to add or change behaviours
- Can extend
ZendService\Oauth2\Client\AbstractClient
- Must implement
ZendService\Oauth2\Client\ClientInterface
- Can extend
- Add custom Oauth2.0 flows by adding custom authorization grants:
- Can extend
ZendService\Oauth2\AuthorizationGrant\AbstractAuthorizationGrant
- Must implement
ZendService\Oauth2\AuthorizationGrant\AuthorizationGrantInterface
- Can extend
- Supports custom Http clients
- Must implement
ZendService\Oauth2\Http\Client\ClientInterface
- Must implement
Suggestions?
Contact me, write a comment or better yet: fork, implement and create a pull request :-)
All versions of zendservice-oauth2 with dependencies
zendframework/zend-http Version >=2.0.0
zendframework/zend-uri Version >=2.0.0
zendframework/zend-version Version >=2.0.0
zendframework/zend-json Version >=2.0.0