2017 © Pedro Peláez
 

library oauth2-client

Oauth2-Client for simple connect with Oauth2-Server (3rd Party or Own-Aplications)

image

advanced-store/oauth2-client

Oauth2-Client for simple connect with Oauth2-Server (3rd Party or Own-Aplications)

  • Tuesday, October 20, 2015
  • by JayJayOne
  • Repository
  • 10 Watchers
  • 2 Stars
  • 284 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

, (*1)

OAuth2 - Client

This Package can be used to connect to an OAuth2-Service and fetch OAuth2 restricted resources. , (*2)

1. Installation

via Composer

Update your composer.json "require"-Section with this line: , (*3)

    
    "advanced-store/oauth2-client": "dev-master"
    

After adding this line, run the following command: , (*4)

    
    composer install
    or
    composer update
    

2. Configuration

You need to publish the configuration file of this package with: , (*5)

    
    php artisan config:publish advanced-store/oauth2-client
    

The Config-File path is app/config/advanced-store/oauth2-client/config.php

Here you have to add/modify the values for your purpose.
[client.id] - Client-ID of your Application
[client.secret] - Client-Secret of your Application
[scopes] - Scopes for your Application (comma separated) , (*6)

After modifying the Package-Config, update the app/config/app.php
Modify your providers and aliases section, with your preferred alias:

'providers' => array('AdvancedStore\Oauth2Client\Oauth2ClientServiceProvider')
'aliases' => array('OAuth2Client' => 'AdvancedStore\Oauth2Client\Facades\Oauth2ClientFacade') , (*7)

3. Examples

Fetch Access-Token

    
    
    OAuth2Client::fetchAccessToken('http://3rd.party.com/api/access_token', 'password', array(
        'username'  => $credentials['username'],
        'password'  => $credentials['password'],
        'scope'     => Config::get('oauth2-client::scopes'),
    ));
    
    

Requesting a OAuth2 - Restricted Resource/URL

    
    
    $result = OAuth2Client::fetch('http://3rd.party.com/api/restriced/resource');
    
    

4. Constants

Auth methods

  • AUTH_TYPE_URI
  • AUTH_TYPE_AUTHORIZATION_BASIC
  • AUTH_TYPE_FORM

Access token types

  • ACCESS_TOKEN_URI
  • ACCESS_TOKEN_BEARER
  • ACCESS_TOKEN_OAUTH
  • ACCESS_TOKEN_MAC

Grant types

  • GRANT_TYPE_AUTH_CODE
  • GRANT_TYPE_PASSWORD
  • GRANT_TYPE_CLIENT_CREDENTIALS
  • GRANT_TYPE_REFRESH_TOKEN

HTTP Methods

  • HTTP_METHOD_GET
  • HTTP_METHOD_POST
  • HTTP_METHOD_PUT
  • HTTP_METHOD_DELETE
  • HTTP_METHOD_HEAD
  • HTTP_METHOD_PATCH

HTTP Form content types

  • HTTP_FORM_CONTENT_TYPE_APPLICATION
  • HTTP_FORM_CONTENT_TYPE_MULTIPART

The Versions

20/10 2015

dev-master

9999999-dev

Oauth2-Client for simple connect with Oauth2-Server (3rd Party or Own-Aplications)

  Sources   Download

Creative Commons Attribution-NonCommercial-NoDerivatives 4.0

The Requires

 

by advanced STORE GmbH

laravel oauth client oauth2 oauth2-client oauth-client

15/09 2014

dev-4.x_Stable

dev-4.x_Stable

Oauth2-Client for simple connect with Oauth2-Server (3rd Party or Own-Aplications)

  Sources   Download

Creative Commons Attribution-NonCommercial-NoDerivatives 4.0

The Requires

 

by advanced STORE GmbH

laravel oauth client oauth2 oauth2-client oauth-client