Closed EvanEvan-17 closed 2 years ago
can you attach your code?
I'm customising LoginHandler and this is the LoginFromOAuth code:
public virtual async Task<SessionCacheData> LoginFromOAuth(MicrosoftOAuthResponse msToken)
{
var xsts = await GetXsts(msToken);
var xstsXboxLive = await GetXsts(msToken, "http://xboxlive.com"); // I have added RelyingParty parameter and it throws exception when RelyingParty is http://xboxlive.com
var mojangToken = await GetMojangXboxToken(xsts);
var msession = await GetMSession(mojangToken, new MSession());
var sessionCache = new SessionCacheData
{
MicrosoftOAuthToken = msToken,
XstsToken = xsts,
MojangXboxToken = mojangToken,
GameSession = msession,
LiveXstsToken = xstsXboxLive,
};
saveSessionCache(sessionCache);
return sessionCache;
}
In addition, I am using MsalClient from CmlLib.Core.Auth.Microsoft package.
Are there any fix?
fixed. update package XboxAuthNet
to 2.1.0
OK, it worked. Thank you very much! Before this fixed, I use the Minecraft Access Token to authenticate with my API then decode the token to get the XUID, and now I can DIRECTLY get the user's Xbox Live Profile. Awesome!
I use this library and I'm trying to also get user's Xbox Live Profile info for my needs, but when the RelyingParty is http://xboxlive.com it throws XboxAuthException (maybe) and the success XSTS token result is the exception message. Like what? It success but it throws exception and a success result is the message. Can you fix this?