PHPackages                             instkffff/oauth2-eveonline-php7.1 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. instkffff/oauth2-eveonline-php7.1

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

instkffff/oauth2-eveonline-php7.1
=================================

This package provides EveOnline OAuth 2.0 support for the PHP League's OAuth 2.0 Client.

1.0.1(7y ago)0171MITPHPPHP ^7.1

Since Feb 8Pushed 7y ago1 watchersCompare

[ Source](https://github.com/instkffff/oauth2-eveonline-php7.1)[ Packagist](https://packagist.org/packages/instkffff/oauth2-eveonline-php7.1)[ RSS](/packages/instkffff-oauth2-eveonline-php71/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (6)Used By (1)

EveOnline Provider for OAuth 2.0 Client
=======================================

[](#eveonline-provider-for-oauth-20-client)

This package provides EveOnline OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

Installation
------------

[](#installation)

To install, use composer:

```
composer require alcohol/oauth2-eveonline

```

Usage
-----

[](#usage)

Have a look at the [examples](example/).

### Basic Authentication Flow

[](#basic-authentication-flow)

```
$provider = new Alcohol\OAuth2\Client\Provider\EveOnline([
    'clientId' => '{client-id}',
    'clientSecret' => '{client-secret}',
    'redirectUri' => 'https://example.com/callback-url',
    // the following are optional and displayed here with their default values
    'urlAuthorize' => 'https://login.eveonline.com/oauth/authorize',
    'urlAccessToken' => 'https://login.eveonline.com/oauth/token',
    'urlResourceOwnerDetails' => 'https://login.eveonline.com/oauth/verify',
]);

// If we don't have an authorization code then get one
if (!isset($_GET['code'])) {

    // Fetch the authorization URL from the provider; this returns the
    // urlAuthorize option and generates and applies any necessary parameters
    // (e.g. state).
    $authorizationUrl = $provider->getAuthorizationUrl();

    // Get the state generated for you and store it in the session.
    $_SESSION['oauth2state'] = $provider->getState();

    // Redirect the user to the authorization URL.
    header('Location: ' . $authorizationUrl);
    exit;

// Check given state against previously stored one to mitigate CSRF attacks.
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {

    unset($_SESSION['oauth2state']);
    exit('Invalid state');

} else {

    try {

        // Try to get an access token using the authorization code grant.
        $accessToken = $provider->getAccessToken('authorization_code', [
            'code' => $_GET['code']
        ]);

        // We have an access token, which we may use in authenticated
        // requests against the service provider's API.
        echo $accessToken->getToken() . "\n";
        echo $accessToken->getRefreshToken() . "\n";
        echo $accessToken->getExpires() . "\n";
        echo ($accessToken->hasExpired() ? 'expired' : 'not expired') . "\n";

        // Using the access token, we may look up details about the
        // resource owner.
        $resourceOwner = $provider->getResourceOwner($accessToken);

        var_export($resourceOwner->toArray());

    } catch (League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) {

        // Failed to get the access token or user details.
        exit($e->getMessage());
    }
}
```

### Authenticated Requests

[](#authenticated-requests)

```
// The provider provides a way to get an authenticated API request for
// the service, using the access token; it returns an object conforming
// to Psr\Http\Message\RequestInterface.
$request = $provider->getAuthenticatedRequest(
    'GET',
    sprintf('https://crest-tq.eveonline.com/characters/%u/', $user->getId()),
    $accessToken
);

$client = new GuzzleHttp\Client();
$response = $client->send($request);

print $response->getBody();
```

### Refresh Token

[](#refresh-token)

```
// Make sure you check if your token is expired or not, and refresh it when necessary
$existingAccessToken = someMethodThatRetrievesStoredToken();

if ($existingAccessToken->hasExpired()) {
    $newAccessToken = $provider->getAccessToken('refresh_token', [
        'refresh_token' => $existingAccessToken->getRefreshToken()
    ]);

    // Purge old access token and store new access token
}
```

Testing
-------

[](#testing)

> Sorry, I got lazy. Just don't break the examples.

Contributing
------------

[](#contributing)

Feel free to submit a pull request or create an issue.

License
-------

[](#license)

oauth2-eveonline is licensed under the MIT license.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 85% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~182 days

Total

5

Last Release

2648d ago

Major Versions

0.2.1 → 1.0.02018-09-05

PHP version history (3 changes)0.1.0PHP ^7.0.0

1.0.0PHP ^7.2

1.0.1PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/3dd28d826cb7407e8462aefac74c9b0bd3948290d05b655b4f11897566842de1?d=identicon)[NightCandle](/maintainers/NightCandle)

---

Top Contributors

[![alcohol](https://avatars.githubusercontent.com/u/21414?v=4)](https://github.com/alcohol "alcohol (17 commits)")[![instkffff](https://avatars.githubusercontent.com/u/3518214?v=4)](https://github.com/instkffff "instkffff (2 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (1 commits)")

---

Tags

AuthenticationSSOidentityoauthoauth2authorizationidpsingle sign onEVE OnlineCRESTeveccpspace pixelsdank memes

### Embed Badge

![Health badge](/badges/instkffff-oauth2-eveonline-php71/health.svg)

```
[![Health](https://phpackages.com/badges/instkffff-oauth2-eveonline-php71/health.svg)](https://phpackages.com/packages/instkffff-oauth2-eveonline-php71)
```

###  Alternatives

[adam-paterson/oauth2-slack

Slack OAuth 2.0 Client Provider for The PHP League OAuth2-Client

22694.8k5](/packages/adam-paterson-oauth2-slack)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
