2017 © Pedro Peláez
 

library oauth2-modulbank

Modulbank Provider for the OAuth 2.0 Client

image

slowprog/oauth2-modulbank

Modulbank Provider for the OAuth 2.0 Client

  • Monday, July 18, 2016
  • by SlowProg
  • Repository
  • 1 Watchers
  • 1 Stars
  • 97 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Modulbank Provider for OAuth 2.0 Client

This package provides Modulbank OAuth 2.0 support for the PHP League's OAuth 2.0 Client., (*1)

Installation

To install, use composer:, (*2)

composer require slowprog/oauth2-modulbank

Usage

Usage is the same as The League's OAuth client, using \League\OAuth2\Client\Provider\Modulbank as the provider., (*3)

Authorization Code Flow

$provider = new \League\OAuth2\Client\Provider\Modulbank([
    'clientId'          => '{modulbank-client-id}',
    'clientSecret'      => '{modulbank-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url',
    'debug'             => false
]);

// Get url for registration which must transfer to browser (send GET)
// $url = $provider->getRegistrationUrl($firstName, $lastName, $email, $cellPhone);
// Or
// Get url for authorization which must transfer to browser (send POST)
$url = $provider->getAuthorizationUrlShort();
$params = $provider->getAuthorizationParams([
    'scope' => 'account-info operation-history assistant-service money-transfer',
]);

Callback file:, (*4)

$provider = new \League\OAuth2\Client\Provider\Modulbank([
    'clientId'          => '{modulbank-client-id}',
    'clientSecret'      => '{modulbank-client-secret}',
    'debug'             => false
]);

$token = $provider->getAccessToken('authorization_code', [
    'code' => $code
]);

// Use this to interact with an API on the users behalf
echo $token->getToken();

Call methods

$provider = new \League\OAuth2\Client\Provider\Modulbank([
    'clientId'          => '{modulbank-client-id}',
    'clientSecret'      => '{modulbank-client-secret}',
    'token'             => '{modulbank-client-token}',
    'debug'             => false
]);

$info = $provider->getAccountInfo();
// $history = $provider->getOperationHistory('9f65fff4-d638-41d8-83eb-a616039d3fe5');
// $balance = $provider->getBalance('9f65fff4-d638-41d8-83eb-a616039d3fe5');

Managing Scopes

When creating your Modulbank authorization URL, you can specify the state and scopes your application may authorize., (*5)

$params = $provider->getAuthorizationParams([
    'scope' => 'assistant-service money-transfer',
]);

If neither are defined, the provider will utilize internal defaults., (*6)

At the time of authoring this documentation, the following scopes are available., (*7)

  • account-info
  • operation-history
  • assistant-service
  • money-transfer

License

The MIT License (MIT). Please see License File for more information., (*8)

The Versions

18/07 2016

dev-master

9999999-dev

Modulbank Provider for the OAuth 2.0 Client

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andrey Tyshev

authorization oauth client oauth2 authorisation modulbank

18/07 2016

1.0.0

1.0.0.0

Modulbank Provider for the OAuth 2.0 Client

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andrey Tyshev

authorization oauth client oauth2 authorisation modulbank