2017 © Pedro Peláez
 

library slim-oauth2-http

Bridge components for PSR-7 and bshaffer's OAuth2 Server http messages.

image

chadicus/slim-oauth2-http

Bridge components for PSR-7 and bshaffer's OAuth2 Server http messages.

  • Tuesday, January 9, 2018
  • by chadicus
  • Repository
  • 3 Watchers
  • 17 Stars
  • 45,730 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 9 Forks
  • 2 Open issues
  • 24 Versions
  • 16 % Grown

The README.md

Chadicus\Slim\OAuth2\Http

Build Status Code Quality Code Coverage, (*1)

Latest Stable Version Latest Unstable Version License, (*2)

Total Downloads Daily Downloads Monthly Downloads, (*3)

Documentation, (*4)

Static utilitiy classes to bridge PSR-7 http messages to OAuth2 Server requests and responses. While this libray is entended for use with Slim 3, it should work with any PSR-7 compatible framework., (*5)

Requirements

Chadicus\Slim\OAuth2\Http requires PHP 5.6 (or later)., (*6)

Composer

To add the library as a local, per-project dependency use Composer! Simply add a dependency on chadicus/slim-oauth2-http to your project's composer.json file such as:, (*7)

composer require chadicus/slim-oauth2-http

Contact

Developers may be contacted at:, (*8)

Project Build

With a checkout of the code get Composer in your PATH and run:, (*9)

composer install
./vendor/bin/phpunit
./vendor/bin/phpcs

Community

Gitter, (*10)

Available Operations

Convert a PSR-7 request to an OAuth2 request

use Chadicus\Slim\OAuth2\Http\RequestBridge;

$oauth2Request = RequestBridge::toOAuth2($psrRequest);

Convert an OAuth2 response to a PSR-7 response.

use Chadicus\Slim\OAuth2\Http\ResponseBridge;

$psr7Response = ResponseBridge::fromOAuth2($oauth2Request);

Example Integeration

Simple route for creating a new oauth2 access token

use Chadicus\Slim\OAuth2\Http\RequestBridge;
use Chadicus\Slim\OAuth2\Http\ResponseBridge;
use OAuth2;
use OAuth2\GrantType;
use OAuth2\Storage;
use Slim;

$storage = new Storage\Memory(
    [
        'client_credentials' => [
            'testClientId' => [
                'client_id' => 'testClientId',
                'client_secret' => 'testClientSecret',
            ],
        ],
    ]
);

$server = new OAuth2\Server(
    $storage,
    [
        'access_lifetime' => 3600,
    ],
    [
        new GrantType\ClientCredentials($storage),
    ]
);

$app = new Slim\App();

$app->post('/token', function ($psrRequest, $psrResponse, array $args) use ($app, $server) {
    //create an \OAuth2\Request from the current \Slim\Http\Request Object
    $oauth2Request = RequestBridge::toOAuth2($psrRequest);

    //Allow the oauth2 server instance to handle the oauth2 request
    $oauth2Response = $server->handleTokenRequest($oauth2Request),

    //Map the oauth2 response into the slim response
    return ResponseBridge::fromOAuth2($oauth2Response);
});

The Versions

09/01 2018

dev-chadicus-patch-1

dev-chadicus-patch-1

Bridge components for PSR-7 and bshaffer's OAuth2 Server http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http psr7 request oauth2 response slim message bridge

08/01 2018

dev-master

9999999-dev

Bridge components for PSR-7 and bshaffer's OAuth2 Server http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http psr7 request oauth2 response slim message bridge

07/01 2018

4.x-dev

4.9999999.9999999.9999999-dev

Bridge components for PSR-7 and bshaffer's OAuth2 Server http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http psr7 request oauth2 response slim message bridge

07/01 2018

v3.1.6

3.1.6.0

Bridge components for PSR-7 and bshaffer's OAuth2 Server http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http psr7 request oauth2 response slim message bridge

07/01 2018

dev-dev/composer

dev-dev/composer

Bridge components for PSR-7 and bshaffer's OAuth2 Server http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http psr7 request oauth2 response slim message bridge

22/11 2017

v3.1.5

3.1.5.0

Bridge components for PSR-7 and bshaffer's OAuth2 Server http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http psr7 request oauth2 response slim message bridge

01/10 2017

v3.1.4

3.1.4.0

Bridge components for PSR-7 and bshaffer's OAuth2 Server http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http psr7 request oauth2 response slim message bridge

10/01 2017

v3.1.3

3.1.3.0

Bridge components for PSR-7 and bshaffer's OAuth2 Server http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http psr7 request oauth2 response slim message bridge

03/01 2017

v3.1.2

3.1.2.0

Bridge components for PSR-7 and bshaffer's OAuth2 Server http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http psr7 request oauth2 response slim message bridge

15/11 2016

v3.1.1

3.1.1.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

15/11 2016

v3.1.0

3.1.0.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

10/06 2016

1.x-dev

1.9999999.9999999.9999999-dev

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

10/06 2016

v1.0.1

1.0.1.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

23/05 2016

v3.0.3

3.0.3.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

23/05 2016

v3.0.2

3.0.2.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

22/05 2016

v3.0.1

3.0.1.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

22/05 2016

v3.0.0

3.0.0.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

03/02 2016

v1.0.0

1.0.0.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

23/09 2015

v0.1.5

0.1.5.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

17/09 2015

v0.1.4

0.1.4.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

29/07 2015

v0.1.3

0.1.3.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

27/07 2015

v0.1.2

0.1.2.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

24/07 2015

v0.1.1

0.1.1.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message

15/07 2015

v0.1.0

0.1.0.0

Bridge components for slim and oauth2 http messages.

  Sources   Download

MIT

The Requires

 

The Development Requires

http oauth2 slim message