Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DeviceTypeAndroid = DeviceType{ DeviceType: "Android", ClientID: "0000000048183522", TitleID: "1739947436", Version: "8.0.0", UserAgent: "XAL Android 2020.07.20200714.000", } DeviceTypeIOS = DeviceType{ DeviceType: "iOS", ClientID: "000000004c17c01a", TitleID: "1810924247", Version: "15.6.1", UserAgent: "XAL iOS 2021.11.20211021.000", } DeviceTypeWindows = DeviceType{ DeviceType: "Win32", ClientID: "0000000040159362", TitleID: "896928775", Version: "10.0.0", UserAgent: "XAL", } DeviceTypeNintendo = DeviceType{ DeviceType: "Nintendo", ClientID: "00000000441cc96b", TitleID: "2047319603", Version: "0.0.0", UserAgent: "XAL", } DeviceTypePlaystation = DeviceType{ DeviceType: "Playstation", ClientID: "000000004827c78e", TitleID: "idk", Version: "10.0.0", UserAgent: "XAL", } )
Functions ¶
func RefreshToken ¶
RefreshToken refreshes the oauth2.Token passed and returns a new oauth2.Token. An error is returned if refreshing was not successful.
func RequestLiveTokenWriter ¶
func RequestLiveTokenWriter(ctx context.Context, deviceType *DeviceType, h MSAuthHandler) (*oauth2.Token, error)
RequestLiveTokenWriter does a login request for Microsoft Live Connect using device auth. A login URL will be printed to the io.Writer passed with a user code which the user must use to submit. Once fully authenticated, an oauth2 token is returned which may be used to login to XBOX Live.
Types ¶
type DeviceType ¶
type MSAuthHandler ¶
type XBLToken ¶
type XBLToken struct { AuthorizationToken struct { DisplayClaims struct { UserInfo []struct { GamerTag string `json:"gtg"` XUID string `json:"xid"` UserHash string `json:"uhs"` } `json:"xui"` } Token string } }
XBLToken holds info on the authorization token used for authenticating with XBOX Live.
func RequestXBLToken ¶
func RequestXBLToken(ctx context.Context, liveToken *oauth2.Token, relyingParty string, deviceType *DeviceType) (*XBLToken, error)
RequestXBLToken requests an XBOX Live auth token using the passed Live token pair.
func (XBLToken) SetAuthHeader ¶
SetAuthHeader returns a string that may be used for the 'Authorization' header used for Minecraft related endpoints that need an XBOX Live authenticated caller.