PHPackages                             evolic/oauth2-eveonline - 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. evolic/oauth2-eveonline

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

evolic/oauth2-eveonline
=======================

EvE Online OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2.0.1(5y ago)041MITPHPPHP &gt;=5.5.0

Since Feb 6Pushed 5y agoCompare

[ Source](https://github.com/evolic/oauth2-eveonline)[ Packagist](https://packagist.org/packages/evolic/oauth2-eveonline)[ RSS](/packages/evolic-oauth2-eveonline/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

EVE Online Provider for OAuth 2.0 Client
========================================

[](#eve-online-provider-for-oauth-20-client)

[![Latest Version](https://camo.githubusercontent.com/d5fa6bef71a31cb04908320987a9a54fdbb9ecbfa60abbb2c0aad1c6a177b243/68747470733a2f2f706f7365722e707567782e6f72672f6576656c6162732f6f61757468322d6576656f6e6c696e652f762f737461626c65)](https://packagist.org/packages/evelabs/oauth2-eveonline)[![Software License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/6df3781cec4637cf368fe20df89ef08c7ed179229459d4b6de273fda43cb4a76/68747470733a2f2f7472617669732d63692e6f72672f4576454c6162732f6f61757468322d6576656f6e6c696e652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/EvELabs/oauth2-eveonline)[![Code Coverage](https://camo.githubusercontent.com/9eb83da1a0aaa5dfbe5023e5bfb1b1be6f9730ff1259db62082e525a34cf2340/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4576454c6162732f6f61757468322d6576656f6e6c696e652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/EvELabs/oauth2-eveonline/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9c9b378e35a4d87320709a12b731ed3a2bcd92fd4073fca96952807a64d5acd7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4576454c6162732f6f61757468322d6576656f6e6c696e652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/EvELabs/oauth2-eveonline/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/cc396fcae9a812daaa482cd3bd93b62ce90c1a3fe25186a9515d65a47a1b8cbe/68747470733a2f2f706f7365722e707567782e6f72672f6576656c6162732f6f61757468322d6576656f6e6c696e652f646f776e6c6f616473)](https://packagist.org/packages/evelabs/oauth2-eveonline)

This package provides Eve Online 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 evelabs/oauth2-eveonline

```

Docs
----

[](#docs)

[Eve Online CREST&amp;SSO 3rd party documentation](http://eveonline-third-party-documentation.readthedocs.org/en/latest/crest/authentication/)

Usage
-----

[](#usage)

Usage is the same as The League's OAuth client, using `\Evelabs\OAuth2\Client\Provider\EveOnline` as the provider.

See `example/example.php` for more insight.

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new Evelabs\OAuth2\Client\Provider\EveOnline([
    'clientId'          => '{eveonline-client-id}',
    'clientSecret'      => '{eveonline-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url',
]);

if (!isset($_GET['code'])) {

    // If we don't have an authorization code then get one
    $authUrl = $provider->getAuthorizationUrl();
    $_SESSION['oauth2state'] = $provider->getState();
    header('Location: '.$authUrl);
    exit;

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

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

} else {

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

    // Optional: Now you have a token you can look up a users profile data
    try {

        // We got an access token, let's now get the user's details
        $user = $provider->getResourceOwner($token);

        // Use these details to create a new profile
        printf('Hello %s!', $user->getCharacterName());

    } catch (Exception $e) {

        // Failed to get user details
        exit('Oh dear...');
    }

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

### Managing Scopes

[](#managing-scopes)

When creating your EveOnline authorization URL, you can specify the scopes your application may authorize.

```
$options = [
    'scope' => ['publicData','characterLocationRead'] // array or string
];

$authorizationUrl = $provider->getAuthorizationUrl($options);
```

### Refreshing access token

[](#refreshing-access-token)

EVE Online Oauth server issues short-lived(around 20 minutes) access tokens so once it expires you have to obtain a new one using long-lived refresh token.

```
$new_token = $provider->getAccessToken('refresh_token', [
    'refresh_token' => $old_token->getRefreshToken()
]);
```

### Calling CREST

[](#calling-crest)

Once you've obtained both (access &amp; refresh) tokens you can start making requests.

#### Example GET

[](#example-get)

```
$request = $provider->getAuthenticatedRequest(
    'GET',
    'https://crest-tq.eveonline.com/characters/{characterID}/',
    $accessToken->getToken()
);

$response = $provider->getResponse($request);
```

#### Example POST

[](#example-post)

```
$request = $provider->getAuthenticatedRequest(
    'POST',
    'https://crest-tq.eveonline.com/characters/{characterID}/',
    $accessToken->getToken(),
    ['body' => 'some stuff']
);

$response = $provider->getResponse($request);
```

Framework integration
---------------------

[](#framework-integration)

Symfony 2

- [KnpUOAuth2ClientBundle](https://github.com/knpuniversity/oauth2-client-bundle)

Testing
-------

[](#testing)

```
$ ./vendor/bin/phpunit
```

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/thephpleague/oauth2-linkedin/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Oleg Krasavin](https://github.com/okwinza)
- [All Contributors](https://github.com/evelabs/oauth2-eveonline/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/evelabs/oauth2-eveonline/blob/master/LICENSE) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 89.5% 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 ~410 days

Total

5

Last Release

2105d ago

Major Versions

1.1.1 → 2.02020-08-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/17f02484ca4bdd20d74bfd0e275e3988f4a282025bfdae1e4bf0a712661a70a4?d=identicon)[evolic](/maintainers/evolic)

---

Top Contributors

[![okwinza](https://avatars.githubusercontent.com/u/108925?v=4)](https://github.com/okwinza "okwinza (17 commits)")[![evolic](https://avatars.githubusercontent.com/u/3501450?v=4)](https://github.com/evolic "evolic (2 commits)")

---

Tags

clientoauthoauth2authorizationauthorisationeveonline

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[stevenmaguire/oauth2-keycloak

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

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

251.7M1](/packages/mollie-oauth2-mollie-php)[omines/oauth2-gitlab

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

36721.5k13](/packages/omines-oauth2-gitlab)[evelabs/oauth2-eveonline

EvE Online OAuth 2.0 Client Provider for The PHP League OAuth2-Client

111.2k](/packages/evelabs-oauth2-eveonline)

PHPackages © 2026

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