4 .. currentmodule:: minecraft.authentication
5 .. _Yggdrasil: http://wiki.vg/Authentication
6 .. _LoginResponse: http://wiki.vg/Authentication#Authenticate
8 The authentication module contains functions and classes to facilitate
9 interfacing with Mojang's Yggdrasil_ authentication service.
15 The most common use for this module in the context of a client will be to
16 log in to a Minecraft account. The first step to doing this is creating
17 an instance of the AuthenticationToken class after which you may use the
18 authenticate method with the user's username and password in order to make the AuthenticationToken valid.
20 .. autoclass:: AuthenticationToken
21 :members: authenticate
23 Upon success, the function returns True, on failure a YggdrasilError
24 is raised. This happens, for example if an incorrect username/password
25 is provided or the web request failed.
27 .. autoexception:: YggdrasilError
34 You may make any arbitrary request to the Yggdrasil service with the _make_request
35 method passing in the AUTH_SERVER as the server parameter.
37 .. automodule:: minecraft.authentication
40 .. autofunction:: _make_request
46 An example of making an arbitrary request can be seen here::
48 payload = {'username': username,
51 authentication._make_request(authentication.AUTH_SERVER, "signout", payload)