コード例 #1
0
function returnProfile($profile)
{
    // Успешная аутентификация
    global $invalidateAllClientTokens;
    if ($invalidateAllClientTokens) {
        invalidateAllTokens($profile['uuid']);
    }
    replaceToken($profile['uuid'], $profile['clientToken'], $profile['accessToken']);
    updateProvider($profile['uuid'], $profile['provider'], $profile['provider'] != "mojang");
    // Настало время охуительных историй
    $profile['uuid'] = logAsHackedProfile($profile['uuid']);
    $profile['name'] = getProfileName($profile['uuid']);
    // Выбранный профиль
    $gameProfile = array("id" => $profile['uuid'], "name" => $profile['name'], "legacy" => 'false');
    // Конечный результат
    $response = array("accessToken" => $profile['accessToken'], "clientToken" => $profile['clientToken'], "selectedProfile" => $gameProfile, "availableProfiles" => array($gameProfile), "provider" => $profile['provider'], "role" => $profile['role']);
    response($response);
}
コード例 #2
0
<?php

/*
 * IMPLEMENTATION OF: https://authserver.mojang.com/signout
 */
define('METHUSELAH_INCLUDE_CHECK', true);
require_once "yggdrasil.php";
$payload = filterPostPayload();
$username = filter_var($payload['username'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH) or responseWithError("Username is empty!");
$password = filter_var($payload['password'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH) or responseWithError("Password is empty!");
// CONVERT username/password into id HERE!
$uuid = md5(strtoupper($username . $password));
if (true) {
    invalidateAllTokens($uuid);
    response();
}
responseWithError("ForbiddenOperationException", "Invalid credentials. Invalid username or password.");