Download the PHP package zfr/zfr-oauth2-server-module without Composer

On this page you can find all versions of the php package zfr/zfr-oauth2-server-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zfr-oauth2-server-module

ZfrOAuth2Module\Server

Build Status Latest Stable Version Coverage Status Total Downloads

ZfrOAuth2Module\Server is a Zend Framework 2 module for ZfrOAuth2\Server. Its goal is to easily create a OAuth 2 compliant server.

Requirements

Versioning note

Please note that until I reach 1.0, I WILL NOT follow semantic version. This means that BC can occur between 0.1.x and 0.2.x releases. If you are using this in production, please set your dependency using 0.1.*, for instance.

Installation

Installation is only officially supported using Composer:

Copy-paste the zfr_oauth2_server.global.php.dist file to your autoload folder, and enable the module by adding ZfrOAuth2Module\Server to your application.config.php file.

Documentation

Configuring the module

ZfrOAuth2Module\Server provides a lot of default configuration. However, there are some information you need to provide.

Setting the User class

When a token is generated, it is automatically linked to an owner. Most of the time, it will be a user. For this mapping to work, you must make sure your user class implements the ZfrOAuth2\Server\Entity\TokenOwnerInterface interface. Then, you need to modify the Doctrine mapping to associate this interface with your own user class. The code is already set in the zfr_oauth2_server.global.php.dist file:

Adding grant types

By default, your OAuth2 server does not support anything. You must configure it by adding all the grants you want to support. For instance, the following config will make your server compatible with the "User credentials" grant as well as the "Refresh token" grant:

Specifying a callable for validating password and username

When using the "User credentials" grant (also called the Password grant), the username and password are automatically passed to a callable. If the callable return a TokenOwnerInterface instance, then it's considered as valid and the access token is created. Otherwise, an error is thrown.

You can also pass a service key, that will be pulled from the service manager, if you need to inject dependencies.

Delete expired tokens

ZfrOAuth2Module\Server offers a console route you can use to delete expired access tokens. You can use this as a CRON task to clean your database. In the public folder, use the following command:

php index.php oauth2 server delete expired tokens.


All versions of zfr-oauth2-server-module with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
zendframework/zend-servicemanager Version ~2.2
zendframework/zend-modulemanager Version ~2.2
zendframework/zend-mvc Version ~2.2
zendframework/zend-http Version ~2.2
zendframework/zend-console Version ~2.2
zendframework/zend-stdlib Version ~2.2
doctrine/doctrine-module Version ~0.9
zfr/zfr-oauth2-server Version 0.7.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zfr/zfr-oauth2-server-module contains the following files

Loading the files please wait ....