PHPackages                             bigpino67/oauth2-xblive - 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. bigpino67/oauth2-xblive

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

bigpino67/oauth2-xblive
=======================

XBOX Live OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1.1.0(8mo ago)81.6kMITPHPPHP ^5.6|^7.0|^8.0

Since Jan 29Pushed 8mo ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

XBOX Live provider for OAuth2 Client
====================================

[](#xbox-live-provider-for-oauth2-client)

This package provides Microsoft Live and XBOX Live 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 bigpino67/oauth2-xblive dev-master

```

### Authorization Code Flow

[](#authorization-code-flow)

```
require_once __DIR__ . '/vendor/autoload.php';

use BigPino67\OAuth2\XBLive\Client\Provider;
use BigPino67\OAuth2\XBLive\Client\Provider\Enum\XBLivePlatformEnum;
use BigPino67\OAuth2\XBLive\Client\Provider\Enum\XboxOneTitleEnum;

$provider = new BigPino67\OAuth2\XBLive\Client\Provider\XBLive([
    'clientId'          => '{YOUR_CLIENT_ID}',
    'clientSecret'      => '{YOUR_CLIENT_SECRET}',
    'redirectUri'       => '{YOUR_LOGIN_REDIRECT_URI}',
    'logoutRedirectUri' => '{YOUR_LOGOUT_REDIRECT_URI}',
]);

if(isset($_POST['code']) && isset($_POST['state']))
{
    if($_POST['state'] == $provider->getState())
    {
        $msaToken = $provider->GetAccessToken('authorization_code', [
            'scope' => $provider->scope,
            'code' => $_POST['code']
        ]);

        $xasuToken = $provider->getXasuToken($msaToken);
        $xstsToken = $provider->getXstsToken($xasuToken);

	$profilesProvider = new Provider\Profiles\ProfilesProvider($xstsToken);
	$profile = $profilesProvider->getLoggedUserProfile();

	$achivementsProvider = new Provider\Achievements\AchievementsProvider($xstsToken);
	$sotAchievements = $achivementsProvider->getAchievements(XboxOneTitleEnum::SeaOfThieves);

        echo "";
        print_r($sotAchievements);
        echo "";
    }
    else
    {
        echo 'Invalid state';
    }
}
else
{
    echo 'Login';
}
```

Examples
--------

[](#examples)

With this library, you can build a web page that looks like this : [![alt text](https://github.com/BigPino67/oauth2-xblive/raw/master/examples/Profile.jpg?raw=true)](https://github.com/BigPino67/oauth2-xblive/blob/master/examples/Profile.jpg?raw=true)[![alt text](https://github.com/BigPino67/oauth2-xblive/raw/master/examples/TitleAchievements.jpg?raw=true)](https://github.com/BigPino67/oauth2-xblive/blob/master/examples/TitleAchievements.jpg?raw=true)[![alt text](https://github.com/BigPino67/oauth2-xblive/raw/master/examples/Friends.jpg?raw=true)](https://github.com/BigPino67/oauth2-xblive/blob/master/examples/Friends.jpg?raw=true)[![alt text](https://github.com/BigPino67/oauth2-xblive/raw/master/examples/Profile_Friend.jpg?raw=true)](https://github.com/BigPino67/oauth2-xblive/blob/master/examples/Profile_Friend.jpg?raw=true)[![alt text](https://github.com/BigPino67/oauth2-xblive/raw/master/examples/TitleAchievements_Friend.jpg?raw=true)](https://github.com/BigPino67/oauth2-xblive/blob/master/examples/TitleAchievements_Friend.jpg?raw=true)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance61

Regular maintenance activity

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1679 days

Total

2

Last Release

250d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8337d0e4ab6e121d793331c00d8477f44617a07ba95a5953717d928e42cee053?d=identicon)[BigPino67](/maintainers/BigPino67)

---

Top Contributors

[![BigPino67](https://avatars.githubusercontent.com/u/15323780?v=4)](https://github.com/BigPino67 "BigPino67 (26 commits)")

---

Tags

clientoauthoauth2microsoftauthorizationxboxxbox livemicrosoft livexbox apixbox live api

### Embed Badge

![Health badge](/badges/bigpino67-oauth2-xblive/health.svg)

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

###  Alternatives

[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)[stevenmaguire/oauth2-keycloak

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

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

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

742.3M12](/packages/stevenmaguire-oauth2-microsoft)[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)

PHPackages © 2026

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