Giter Site home page Giter Site logo

mcauth's Introduction

MCAuth

Minecraft PHP Authentication for Mojang Yggdrasil (http://wiki.vg/Authentication) authentication scheme

Installation

composer require mattiabasone/mc-auth

Example:

Create new MCAuth Object

$MCAuth = new MCAuth\Api();

Authentication:

try {
    $account = $MCAuth->sendAuth("[email protected]", "mypassword");
    var_dump($account);
} catch (Exception $e) {
    echo $e->getMessage();
}

Get UUID from username

try {
    $uuid = $MCAuth->usernameToUuid("_Cyb3r");
    var_dump($uuid);
} catch (Exception $e) {
    echo $e->getMessage();
}

Get username from UUID

try {
    $username = $MCAuth->uuidToUsername("be1cac3b60f04e0dba12c77cc8e0ec21");
    var_dump($username);
} catch (Exception $e) {
    echo $e->getMessage();
}

Warning!

Mojang authentication system permits only one active session as reported in the wiki: "Only the one with the latest session ID for your account are allowed to join servers.", so you will be disconnected from the server where you are playing if you try to login via MCAuth.

mcauth's People

Contributors

mattiabasone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mcauth's Issues

I know this is old, but I need help with it.

I keep getting this error about SSL when I try and login.
SSL certificate problem: unable to get local issuer certificate

I turned off https redirects on my website, and it gave me the same error.

Again, I know this is old, but I would really appreciate it if I could get help with this issue.

what is the const token for?

Hello, I'm just trying to use your script here to do some authentication with mojang, but im just wondering where does "const CLIENT_TOKEN = '808772fc24bc4d92ba2dc48bfecb375f'; // Client token for authentication" come from? I see you get a token in an array back from mojang, but is that something you have to have before you can make the connection?

Invalid Session

Love this, using it as authentication on my website but if someone logs in on the website while client is open they get invalid session from then on till they log out and back in. Is there anyway around this or just how it is due to the way mojang has it setup?

How do i use this.

Hi,

How do i use your code to make a local authentifcation server for Minecrafts Yggdrasil method ?

Curl SSL error

Hello.

i get an Error with the SSL:

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

how do i solve this?

thanks so far, great API

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.