msauth

package module
v0.0.0-...-f765acc Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 16 Imported by: 0

README

msauth

中文README

Microsoft Authentication Scheme for Minecraft

This is a fork of original https://github.com/BaiMeow/msauth. There are few changes:

  1. Translated into English
  2. Added log in method for machines that without PowerShell installed, especially in cosole

Usage

  1. Call SetClient() to set clientID. clientSecret can be empty. For more details, see https://wiki.vg/Microsoft_Authentication_Scheme.
  2. Call Login() to log in

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetClient

func SetClient(id, secret string)

SetClient 来自microsoft的clientID和secret

Types

type AuthResp

type AuthResp struct {
	IssueInstant  time.Time `json:"IssueInstant"`
	NotAfter      time.Time `json:"NotAfter"`
	Token         string    `json:"Token"`
	DisplayClaims struct {
		XUI []struct {
			UHS string `json:"uhs"`
		} `json:"xui"`
	} `json:"DisplayClaims"`
}

type Profile

type Profile struct {
	Id    string `json:"id"`
	Name  string `json:"name"`
	Skins []struct {
		Id      string `json:"id"`
		State   string `json:"state"`
		URL     string `json:"url"`
		Variant string `json:"variant"`
		Alias   string `json:"alias"`
	} `json:"skins"`
	Capes interface{} `json:"capes"`
}

func Login

func Login() (*Profile, string, error)

Login 返回玩家档案,AccessToken

Jump to

Keyboard shortcuts

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