2017 © Pedro Peláez
 

library oauth2-eve

EVE Online Oauth 2.0 Client Provider for The PHP League OAuth2-Client

image

killmails/oauth2-eve

EVE Online Oauth 2.0 Client Provider for The PHP League OAuth2-Client

  • Thursday, May 24, 2018
  • by SobanVuex
  • Repository
  • 1 Watchers
  • 3 Stars
  • 230 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 8 Versions
  • 14 % Grown

The README.md

EVE Online Provider for OAuth 2.0 Client

GitHub Source GitHub Release GitHub License GitHub Actions Workflow Status Packagist Downloads, (*1)

This package provides EVE Online OAuth 2.0 support for the PHP League's OAuth 2.0 Client., (*2)

Installation

To install, use composer:, (*3)

composer require killmails/oauth2-eve:^2.0

Usage

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

Authorization Code Flow

use Killmails\OAuth2\Client\Provider\EveOnline;

$sso = new EveOnline([
    'clientId' => '{eveonline-client-id}',
    'clientSecret' => '{eveonline-client-secret}',
    'redirectUri' => 'https://example.com/callback-url',
]);

if (empty($_GET['code'])) {
    $url = $sso->getAuthorizationUrl();
    $_SESSION['state'] = $sso->getState();

    header('Location: '.$authUrl);
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['state'])) {
    unset($_SESSION['state']);
} else {
    $token = $sso->getAccessToken('authorization_code', [
        'code' => $_GET['code']
    ]);

    $user = $sso->getResourceOwner($token);

    printf('Hello, %s (%d)', $user->getName(), $user->getId());
}

Managing Scopes

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

$options = [
    'scope' => ['esi-killmails.read_killmails.v1']
];

$url = $sso->getAuthorizationUrl($options);

// ...

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

Testing

sh composer test, (*7)

License

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

The Versions

24/05 2018

dev-master

9999999-dev https://github.com/killmails/oauth2-eve

EVE Online Oauth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

authorization oauth client eve online oauth2 authorisation eve eveonline

24/05 2018

1.0.1

1.0.1.0 https://github.com/killmails/oauth2-eve

EVE Online Oauth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

authorization oauth client eve online oauth2 authorisation eve eveonline

24/05 2018

dev-dev-1.1.x

dev-dev-1.1.x https://github.com/killmails/oauth2-eve

EVE Online Oauth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

authorization oauth client eve online oauth2 authorisation eve eveonline

20/05 2018

1.0.0

1.0.0.0

EVE Online Oauth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

authorization oauth client eve online oauth2 authorisation eve eveonline

20/05 2018

0.2.2

0.2.2.0

EVE Online Oauth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

authorization oauth client eve online oauth2 authorisation eve eveonline

20/05 2018

0.2.1

0.2.1.0

EVE Online Oauth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

authorization oauth client eve online oauth2 authorisation eve eveonline

04/02 2016

0.2.0

0.2.0.0

EVE Online Oauth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

authorization oauth client eve online oauth2 authorisation eve eveonline

04/02 2016

0.1.0

0.1.0.0

EVE Online Oauth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

authorization oauth client eve online oauth2 authorisation eve eveonline