auth

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthProvider

type AuthProvider interface {
	// Name returns the name of the auth provider
	Name() string
	// Prompt asks the user to authenticate
	Prompt() error
	// LaunchAuthData returns the auth data needed to launch the game
	LaunchAuthData() (minecraft.LaunchAuthData, error)
}

type Microsoft

type Microsoft struct {
	*microsoft.MicrosoftClient

	Store *credentials.Store
	// contains filtered or unexported fields
}

func (*Microsoft) LaunchAuthData

func (m *Microsoft) LaunchAuthData() (minecraft.LaunchAuthData, error)

func (*Microsoft) Name added in v0.1.17

func (m *Microsoft) Name() string

func (*Microsoft) Prompt

func (m *Microsoft) Prompt() error

func (*Microsoft) SetAuthState

func (m *Microsoft) SetAuthState(authData *MicrosoftCredentialStorage) error

type MicrosoftCredentialStorage added in v0.1.6

type MicrosoftCredentialStorage struct {
	MicrosoftAuth oauth2.Token `json:"ms"`
	PlayerName    string       `json:"pn"`
	UUID          string       `json:"id"`
	AccessToken   string       `json:"at"`
	ExpiresAt     time.Time    `json:"exp"`
	XUID          string       `json:"xuid,omitempty"`
}

MicrosoftCredentialStorage is used to trim down the auth data to the minimum required otherwise the windows keyring will return an error ("The stub received bad data.")

type Mojang

type Mojang struct {
	*mojang.MojangClient
	AuthData *mojang.AuthResponse
	Store    *credentials.Store
}

func (*Mojang) LaunchAuthData

func (m *Mojang) LaunchAuthData() (minecraft.LaunchAuthData, error)

func (*Mojang) Name added in v0.1.17

func (m *Mojang) Name() string

func (*Mojang) Prompt

func (m *Mojang) Prompt() error

func (*Mojang) SetAuthState

func (m *Mojang) SetAuthState(authData *mojang.AuthResponse) error

type PersistentCredentials

type PersistentCredentials struct {
	Provider string
	Data     json.RawMessage
}

Jump to

Keyboard shortcuts

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