MinecraftAuth

class MinecraftAuth(httpClient: HttpClient, xboxClient: XboxLiveAuth)

Provides methods for authenticating with Minecraft-related services.

Parameters

httpClient

An HTTP client used to send requests to Minecraft's authentication service.

xboxClient

An Xbox Live authentication client, used by the loginWithXbox method.

Constructors

Link copied to clipboard
fun MinecraftAuth(httpClient: HttpClient)

Creates a client that communicates with Minecraft's authentication service via the provided httpClient.

Link copied to clipboard
fun MinecraftAuth()

Creates a client that communicates with Minecraft's authentication service via a builtin HttpClient.

Link copied to clipboard
fun MinecraftAuth(httpClient: HttpClient, xboxClient: XboxLiveAuth)

Functions

Link copied to clipboard
fun loginWithMicrosoft(microsoftToken: String): MinecraftToken

Simplifies the login process by logging into Xbox Live internally, then exchanging that token for a Minecraft access token.

Link copied to clipboard
fun loginWithXbox(credentials: XboxLiveToken): MinecraftToken

Exchanges an Xbox Live service token for a Minecraft access token.