msauth

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

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

Go to latest
Published: Dec 25, 2021 License: MIT Imports: 14 Imported by: 0

README

msauth

minecraft的微软验证登陆

使用

1.调用SetClient(clientID,clientSecret)设置clientID,一般clientSecret留空,clientid要先向azure申请,具体见https://wiki.vg/Microsoft_Authentication_Scheme

2.Login()登陆即可获取玩家档案和AccessToken

具体例子见example/example.go

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