Download the PHP package bandronic/oauth2server without Composer

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

OAuth2Server

Implementation of the OAuth2 server using Doctrine ORM.

The package forks BShaffer's OAuth2 implementation and adapts it to use Doctrine, PSR4 and PSR7.

Requirements

bshaffer/oauth2-server-php

dasprid/container-interop-doctrine

Installation

  1. Add the ConfigProvider to the config/container.php file:

  2. In the config/autoload/local.php add an array for oauth2:

    Alternatively you can copy the data\oauth2.local.php.dist file in the config/autoload folder and change the values inside it accordingly.

    You must specify an entity for the user_entity config entry. The user_entity class must implement the interface:

    Optional, if you wish to change the get client details, scope or grant type check, you can specify a client service in the client_service settings parameter. The client service must implement the interface

  3. Create a folder keys in the config folder and inside it generate the private and public keys:

    1. Create a private key openssl genrsa -out private.key 1024
    2. Create a public key openssl rsa -in private.key -pubout > public.key

    Alternatively, you can copy the pre-generated keys from the data folder

    The pre-generated key were generated without a password.

    Alternatively, you can generate the key anywhere in the project structure and specify the location of the keys in the config array under the key 'keys_folder'

Usage

In the routes.php file add the following entries:

Create the database schema using the included migration file: 20171107115657_oauth.php

Add a client:

Authorization

For the authorize method, performing a on the

will validate the URL and redirect to an authorize/deny page

Authorizing will redirect to the provided redirect URI with an authorization token

Posting to the URI with the following body fields:

will return a valid token which you can use multiple times, example:

Password

Add a user with

For the password method, performing a on the route with the following body:

will return an access token, example:

Access token usage

Piping the middleware to a route will verify the access token validity

A valid for

would have to contain the Authorization header. Example:


All versions of oauth2server with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6 || ^7.0
bshaffer/oauth2-server-php Version ~1.8
dasprid/container-interop-doctrine Version 1.0.0
robmorgan/phinx Version ^0.9.1
symfony/http-foundation Version ^3.3
zendframework/zend-config-aggregator Version ^1.0
zendframework/zend-expressive Version ^2.0.2
zendframework/zend-servicemanager Version ^3.3
http-interop/http-server-handler Version ^1.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 bandronic/oauth2server contains the following files

Loading the files please wait ....