Documentation ¶
Index ¶
- Constants
- func CertificateRefresh(auth data.Auth) (data.Auth, error)
- func GetAccountFile() *os.File
- func LoginFromCache(f func(auth data.Auth) bool) data.Auth
- func LoginWithDeviceCode() (data.XboxLiveAuth, error)
- func MinecraftCertificate(auth data.Auth) (data.KeyPair, error)
- func MinecraftJoinServer()
- func MinecraftLogin(xboxSecure data.XboxLiveAuth, save bool) (data.Auth, error)
- func MinecraftProfile(auth data.Auth) (data.Profile, error)
- func MinecraftRefresh(auth data.Auth) (data.Auth, error)
- func ReadMinecraftAccounts() ([]data.Auth, error)
- func WriteMinecraftAccount(account data.Auth) error
Constants ¶
View Source
const ( LiveRedirectURI = "https://login.live.com/oauth20_desktop.srf" LiveTokenRefresh = "https://login.live.com/oauth20_token.srf" )
View Source
const ( XboxLiveAuthorizationEndpoint = "https://user.auth.xboxlive.com/user/authenticate" XboxXSTSAuthorizationEndpoint = "https://xsts.auth.xboxlive.com/xsts/authorize" XboxLiveAuthHost = "user.auth.xboxlive.com" XboxLiveAuthRelay = "http://auth.xboxlive.com" XboxLiveClientID = "000000004C12AE6F" XboxLiveScope = "service::user.auth.xboxlive.com::MBI_SSL" )
View Source
const ( MicrosoftOauth2Host = "https://login.microsoftonline.com/consumers/oauth2/v2.0" MicrosoftAuthorizationEndpoint = MicrosoftOauth2Host + "/authorize" MicrosoftDeviceCodeEndpoint = MicrosoftOauth2Host + "/devicecode" MicrosoftTokenEndpoint = MicrosoftOauth2Host + "/token" MicrosoftNativeClient = MicrosoftOauth2Host + "/nativeclient" MicrosoftScope = "XboxLive.signin offline_access" MicrosoftClientID = "88650e7e-efee-4857-b9a9-cf580a00ef43" )
View Source
const ( MinecraftAuthorizationEndpoint = "https://api.minecraftservices.com/authentication/login_with_xbox" MinecraftProfileEndpoint = "https://api.minecraftservices.com/minecraft/profile" MinecraftCertificateEndpoint = "https://api.minecraftservices.com/player/certificates" MinecraftAuthRelay = "rp://api.minecraftservices.com/" MinecraftAuthenticateEndpoint = "https://authserver.mojang.com/authenticate" )
View Source
const ( DefaultCacheFile = "auth.cache" DefaultKeyPairFile = "keypair.pem" )
Variables ¶
This section is empty.
Functions ¶
func GetAccountFile ¶
func LoginWithDeviceCode ¶
func LoginWithDeviceCode() (data.XboxLiveAuth, error)
func MinecraftCertificate ¶
MinecraftCertificate fetches the certificate of a Minecraft account. This is required for joining servers and sending messages on strict servers.
func MinecraftJoinServer ¶
func MinecraftJoinServer()
MinecraftJoinServer joins a Minecraft server with a Minecraft account.
func MinecraftLogin ¶
MinecraftLogin logs in with a data.XboxLiveAuth and returns a Minecraft account. If save is true, the account will be saved to the accounts.json file.
func MinecraftProfile ¶
MinecraftProfile fetches the profile of a Minecraft account.
func MinecraftRefresh ¶
MinecraftRefresh refreshes the access token of a Minecraft account. Can be used for login as well. If the account has no profile, it will be fetched.
func ReadMinecraftAccounts ¶
func WriteMinecraftAccount ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.