Companion

object Companion

Properties

Link copied to clipboard
val JAVA_APPLICATION_CONFIG: MsaApplicationConfig

The official Minecraft (Java Edition) launcher application.

Functions

Link copied to clipboard
fun buildFromCredentials(email: String, password: String, applicationConfig: MsaApplicationConfig = JAVA_APPLICATION_CONFIG): MicrosoftAccount

Does not support accounts with two-factor authentication enabled; use buildFromWebView or buildFromDeviceCode for those.

Link copied to clipboard
fun buildFromDeviceCode(onDeviceCode: Consumer<MsaDeviceCode>, applicationConfig: MsaApplicationConfig = JAVA_APPLICATION_CONFIG, timeoutMs: Int = DEFAULT_TIMEOUT_MS): MicrosoftAccount

onDeviceCode is invoked once with the code the user has to enter at the returned verification URL; this blocks until the user completes the sign-in, the code expires, or timeoutMs elapses.

Link copied to clipboard
fun buildFromRefreshToken(refreshToken: String, applicationConfig: MsaApplicationConfig = JAVA_APPLICATION_CONFIG): MicrosoftAccount

applicationConfig must match the one the refresh token was originally issued for.

Link copied to clipboard
fun buildFromWebView(onOpen: (ExternalBrowserMsaAuthService) -> Unit, onClose: (ExternalBrowserMsaAuthService) -> Unit, applicationConfig: MsaApplicationConfig = JAVA_APPLICATION_CONFIG, timeoutMs: Int = DEFAULT_TIMEOUT_MS): MicrosoftAccount

Signs in through a browser the caller supplies. Preferred over the other flows, as it supports 2FA, passkeys and everything else Microsoft offers.