Download the PHP package misarji/zend-oauth2 without Composer
On this page you can find all versions of the php package misarji/zend-oauth2. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download misarji/zend-oauth2
More information about misarji/zend-oauth2
Files in misarji/zend-oauth2
Package zend-oauth2
Short Description Great OAuth2 client for ZF2. It provides clients for github, google, facebook and linkedin, others are coming soon.
License MIT
Homepage https://github.com/misarji/ZendOAuth2
Informations about the package zend-oauth2
ZendOAuth2
Great OAuth2 client for ZF2. It provides clients for github, google, facebook and linkedin, others are coming soon.
The library is kept as simple as possible, it does not provide routes or controllers.
Installation with Composer
-
Add this project in your
composer.json
: -
Fetch the repository with composer:
- Enable it in your
config/application.config.php
file:
Usage
As usual add it to your application.config.php 'ZendOAuth2'.
Copy & rename the config/zendoauth2.local.php.dist
to your autoload folder and fill the information needed.
In your controller/action do:
The action name depends on your settings. getUrl() will return the url where you should redirect the user, there is no automatic redirection do it yourself.
Client Configuration
Beside the configuration options in module.config.php
and reverseoath2.local.php
you can change the client configuration on runtime.
The ZendOAuth2 authentication adapter
The module provides also an zend\authentication\adapter.
The adapter also provides an event called oauth2.success
. Here you can check the data from the client against your user registry. You will be provided with
information from the user, token info and provider type.
In your module class you could do:
TODO
- Add other clients
- Write some decent documentation.
- Demo module is on it's way.