microsoft

package
v0.0.0-...-18e7427 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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 CertificateRefresh

func CertificateRefresh(auth data.Auth) (data.Auth, error)

func GetAccountFile

func GetAccountFile() *os.File

func LoginFromCache

func LoginFromCache(f func(auth data.Auth) bool) data.Auth

func LoginWithDeviceCode

func LoginWithDeviceCode() (data.XboxLiveAuth, error)

func MinecraftCertificate

func MinecraftCertificate(auth data.Auth) (data.KeyPair, error)

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

func MinecraftLogin(xboxSecure data.XboxLiveAuth, save bool) (data.Auth, error)

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

func MinecraftProfile(auth data.Auth) (data.Profile, error)

MinecraftProfile fetches the profile of a Minecraft account.

func MinecraftRefresh

func MinecraftRefresh(auth data.Auth) (data.Auth, error)

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 ReadMinecraftAccounts() ([]data.Auth, error)

func WriteMinecraftAccount

func WriteMinecraftAccount(account data.Auth) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL