auth

package
v0.0.0-...-198373c Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const AzureClientIDEnvVar = "AzureClientID"

AzureClientIDEnvVar Used to lookup Azure client id via os.Getenv if cid is not passed

Variables

This section is empty.

Functions

func AuthMSLogin

func AuthMSLogin(username, password string) (string, error)

func AuthXBL

func AuthXBL(MStoken string) (string, error)

AuthXBL Gets XBox Live token from Microsoft token

func GetMCcredentialsByPassword

func GetMCcredentialsByPassword(username, password string) (*oauth2.Token, error)

GetMCcredentialsByPassword From 0 to Minecraft Auth with cache using password flow

func ReadAccount

func ReadAccount(authName string, forceUpdate ...bool) (*oauth2.Token, error)

Types

type Account

type Account map[string]*oauth2.Token

type MCauth

type MCauth struct {
	Token        string
	ExpiresAfter int64
}

MCauth Represents Minecraft auth response

func AuthMC

func AuthMC(token XSTSauth) (MCauth, error)

AuthMC Gets Minecraft authorization from XSTS token

type MSauth

type MSauth struct {
	AccessToken  string
	ExpiresAfter int64
	RefreshToken string
}

MSauth holds Microsoft auth credentials

func RefreshMSCode

func RefreshMSCode(code, cid string) (auth *MSauth, err error)

RefreshMSCode Checks MSauth for expired token and refreshes if needed

type XSTSauth

type XSTSauth struct {
	Token string
	UHS   string
}

XSTSauth Holds XSTS token and UHS

func AuthXSTS

func AuthXSTS(XBLtoken string) (XSTSauth, error)

AuthXSTS Gets XSTS token using XBL

Jump to

Keyboard shortcuts

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