定制 aberdeener/minecraft-oauth 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aberdeener/minecraft-oauth

最新稳定版本:0.1.1

Composer 安装命令:

composer require aberdeener/minecraft-oauth

包简介

Provides easy layer to get a Minecraft profile from a Microsoft Live OAuth session

README 文档

README

Provides easy layer to get a Minecraft profile (UUID, username, skins, capes) from a Microsoft Live OAuth session.

require 'vendor/autoload.php';

$client_id = '<Azure OAuth Client ID>';
$client_secret = '<Azure OAuth Client Secret>';
$redirect_uri = '<URL to this file>';

try {
    $profile = (new \Aberdeener\MinecraftOauth\MinecraftOauth)->fetchProfile(
        $client_id,
        $client_secret,
        $_GET['code'],
        $redirect_uri,
    );
} catch (\Aberdeener\MinecraftOauth\Exceptions\MinecraftOauthException $e) {
    echo $e->getMessage();
}

echo 'Minecraft UUID: ' . $profile->uuid();
echo 'Minecraft Username: ' . $profile->username();
echo 'Minecraft Skin URL: ' . $profile->skins()[0]->url();
echo 'Minecraft Cape URL: ' . $profile->capes()[0]->url();

统计信息

  • 总下载量: 47
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-01