Download the PHP package codeacious/oauth2-provider without Composer

On this page you can find all versions of the php package codeacious/oauth2-provider. 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 oauth2-provider

oauth2-provider

A simple and clean Zend Framework 2 wrapper for the oauth2-server-php library.

The main features:

Installation

  1. Use Composer to add the package codeacious/oauth2-provider to your project.
  2. Add Codeacious\OAuth2Provider to the list of modules to load in your config/application.config.php

Provider instantiation

The central class is Codeacious\OAuth2Provider\Provider, which wraps an OAuth2\Server instance. You interact with the Provider from your own controllers to perform OAuth functions.

There are several ways to instantiate a Provider, depending on whether you want to use the Service Manager and whether your project requires more than one Provider.

Service manager - single instance

Codeacious\OAuth2Provider\ProviderFactory is a service factory that creates a single Provider and looks for configuration options under the oauth2provider key in your app config.

For example, put this in your config/autoload/global.php or module/Application/config/module.config.php:

From your controller class, you can retrieve the service:

Service manager - multiple instances

Codeacious\OAuth2Provider\ProviderAbstractFactory is an abstract factory that allows you to define any number of Providers just by placing uniquely named keys under the oauth2providers key in your app config.

For example, put this in your config/autoload/global.php or module/Application/config/module.config.php:

From your controller class, you can retrieve the services using the names you chose:

The manual way

You can create a Provider yourself by passing in a preconfigured OAuth server, and your current Request.

Configuration

When using the service factories, you can configure the OAuth2 server from your ZF application config array. You can configure storage, request types and most other options using this mechanism.

Example: OAuth token issuer with PDO storage

Example: Custom storage using services

Example: Assigning storage objects to specific storage types

Example: Accepting JWT tokens using a public key stored in a file

Usage

The oauth2-provider module does not implement any controllers or register any routes. Leaving these aspects to your application gives you more control and flexibility.

Implementing a token endpoint

Create a controller and set up URL routing as you normally would in Zend Framework. In the action handler for your token action, retrieve the provider you configured in the Service Manager, and call handleTokenRequest(). For example:

Implementing an authorization endpoint

The Authorization endpoint requires you to implement a login form or other mechanism to establish the user's identity. Once you've done that, you can call handleAuthorizeRequest() to let the provider take over. Here's a simplistic example:

Accepting tokens

Accepting tokens using ZF\MvcAuth


All versions of oauth2-provider with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
bshaffer/oauth2-server-php Version ~1.0
zendframework/zend-http Version ~2.0
zendframework/zend-servicemanager Version ~2.0
zendframework/zend-filter Version ~2.0
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 codeacious/oauth2-provider contains the following files

Loading the files please wait ....