Documentation
¶
Overview ¶
Package auth provides functions related to game authentication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MSA msaT
Functions ¶
func ReadFromCache ¶
func ReadFromCache() error
ReadFromCache reads an AuthStore into the global store from the file specified in env.AuthStorePath
This function should be run in order to load the authentication info from the cache. If it is not, the global AuthStore will be blank.
Types ¶
type AuthStore ¶
type AuthStore struct {
MSA msaAuthStore `json:"msa"`
XBL xblAuthStore `json:"xbl"`
XSTS xstsAuthStore `json:"xsts"`
Minecraft minecraftAuthStore `json:"minecraft"`
}
An AuthStore is an authentication store which stores necessary information to log in.
var Store AuthStore
Store is the global authentication store.
func (*AuthStore) Clear ¶
Clear clears the store and writes it to the file specified in env.AuthStorePath
func (*AuthStore) WriteToCache ¶
WriteToCache writes the store to the file specified in env.AuthStorePath
type Session ¶
A Session holds the necessary information to start Minecraft authenticated.
func Authenticate ¶
Authenticate authenticates with all necessary endpoints, or cached data if available and returns a Session.
func AuthenticateWithCode ¶
AuthenticateWithCode authenticates with a device code.
This function blocks until the user has been authenticated, or another error has occurred.
func AuthenticateWithRedirect ¶
AuthenticateWithRedirect authenticates using the OAuth2 Code flow.
This function blocks until a response has been recieved on the local authentication server.