Download the PHP package izub/oauth2-provider without Composer
On this page you can find all versions of the php package izub/oauth2-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download izub/oauth2-provider
More information about izub/oauth2-provider
Files in izub/oauth2-provider
Package oauth2-provider
Short Description ZF3 OAuth2 Provider module
License MIT
Homepage https://github.com/izub/OAuth2Provider
Informations about the package oauth2-provider
OAuth 2 Provider Module for Zend Framework 3
OAuth2Provider module integrates Brent Shaffer's OAuth2 Server with Zend Framework 3 easily.
Installation
-
Easiest is through composer.
or in composer.json
then run
composer update
- Setup your configuration
- Create 'oauth2provider' config key in your application's module.config.php
- Copy the contents from OAuth2Provider/config/module.config.php.dist or rename this file to module.config.php if you dont have an existing module.config.php. If copying, make sure to copy only the data inside the 'oauth2provider' config key.
- Fill up the configuration with your own settings. Refer to Configuration Options for documentation below.
-
Define the main_server
- Under the
oauth2provider
config key should be amain_server
configuration. -
Fill the
main_server
key with the custom server name you defined from step 2. The main_server will use the namedefault
as the default name for a server key.Example:
- Under the
- Enable the OAuth2Provider module in your
application.config.php
Configuration Options
You can also view the configuration documentation in configs/oauth2provider.config.php
. Each configuration section has its own config options that can be viewed separately in OAuth2Provider\Options\*
Usage
- You can access the server through the main Service Manager by:
$sm->get('oauth2provider.server.main');
or if you have a specific server key will be:
$sm->get('oauth2provider.server.my_custom_server_key');
- You can also access each configuration (for example: 'grant_type') object by:
$sm->get('oauth2provider.server.main.grant_type.user_credentials');
- Access the server's Request object by:
$sm->get('oauth2provider.server.main.request');
- Access the server's Response object by:
$sm->get('oauth2provider.server.main.response');
Routing
- The url below will automatically be created:
- Request end point:
http://[domain]/oauth2/request
- Resource end point:
http://[domain]/oauth2/resource
- Authorize end point:
http://[domain]/oauth2/authorize
- Request end point:
Multiple Server Versions
-
You can define specific and multiple versions for your server:
- With the above config setup, an end point of
http://[domain]/oauth2/request
will automatically point to 'v2' - You should still be able to access version1 (v1) by specifying the version in the url as such:
http://[domain]/oauth2/v1/request
- With the above config setup, an end point of
Controllers
-
Currently only a 2 legged with grant_type 'user_credentials' controller is available but you can apply your own controller by implementing interface
OAuth2Provider\Controller\ControllerInterface
and defining the controler in:- the endpoints/routing above will still be valid
All versions of oauth2-provider with dependencies
bshaffer/oauth2-server-php Version ^1.12
laminas/laminas-loader Version ^2.6
laminas/laminas-mvc Version ^3.1
laminas/laminas-modulemanager Version ^2.8
laminas/laminas-servicemanager Version ^3.4
laminas/laminas-stdlib Version ^3.2
laminas/laminas-view Version ^2.11
laminas/laminas-filter Version ^2.9
laminas/laminas-http Version ^2.10