Skip to content

Interface IMojangService

Namespace: Void.Minecraft.Mojang
Assembly: Void.Minecraft.dll

Provides Mojang session authentication for online-mode players joining the proxy.

public interface IMojangService

Methods

VerifyAsync(IPlayer, CancellationToken)

Verifies that the player has authenticated with the Minecraft session server by computing a Java-style SHA-1 server ID from the encryption shared secret and the proxy’s RSA public key, then querying sessionserver.mojang.com/session/minecraft/hasJoined with the player’s username and the computed server ID. When offline mode is enabled, the verification step is skipped entirely and a with an offline-mode UUID derived from the player’s username is returned immediately.

ValueTask<GameProfile?> VerifyAsync(IPlayer player, CancellationToken cancellationToken = default)

Parameters

player IPlayer

The player to authenticate. The player’s profile must already contain at least a username before this method is called.

cancellationToken CancellationToken

A token to cancel the HTTP request to the session server.

Returns

ValueTask<GameProfile?>

The returned by Mojang’s session server if verification succeeds, or null if the session server responds with HTTP 204 No Content, which indicates that the player has not joined the session and authentication should be refused.