MSAL API
Xal-Node API for MSAL authentication
Load the library
Performing authentication
The below method will return an object with details with an url and code which the user can use to authenticate. The user can then authenticate on their personal device.
Refresh user token
Tokens are refreshed automatically when they are expired. The code below shows an example to force refresh the user token.
Retrieve MSAL token
The MSAL token is used to send over to xCloud to login on the xCloud console with your account. This token is short lived and expires within 15 minutes.
Retrieve web token
The web token is used to retrieve data using the Xbox Web API. This includes current friend lists, achievements and smartglass controls.
Retrieve Streaming tokens
Use streaming tokens contains both the xHome and xCllud tokens. If the user does not have an active Gamepass subscription, the xCloud F2P token is retrieved.