JosefNemec / PlayniteExtensions

Extensions for Playnite game launcher and manager.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Xbox plugin doesn't authenticate

XenorPLxx opened this issue · comments

Check for existing issue
No similar issues found on Github, there were otherrs reporting on Discord.

Describe the bug
A clear and concise description of what the bug is.
When refreshing the library Xbox pluging errored out:

01-12 01:27:21.306|ERROR|XboxLibrary#XboxLibrarySettingsViewModel:Failed to authenticate user.
System.NullReferenceException: Object reference not set to an instance of an object.
   at XboxLibrary.Services.XboxAccountClient.<Authenticate>d__8.MoveNext() in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\Services\XboxAccountClient.cs:line 159
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at XboxLibrary.Services.XboxAccountClient.<Login>d__6.MoveNext() in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\Services\XboxAccountClient.cs:line 90
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at XboxLibrary.XboxLibrarySettingsViewModel.<Login>d__9.MoveNext() in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\XboxLibrarySettingsViewModel.cs:line 59

After trying to reauthenticate, it goes through the authentication process successfully but registers authentication, going back in circles.

I tried removing contests of plugins data folder and clearing web cache, didn't help.

To Reproduce
Seems like logging in on a freshly installed add-on with no web cache is enough to trigger the bug, at least on my account.

Screenshots
Recording from another user on Discord, mine behaves the same.
https://github.com/JosefNemec/PlayniteExtensions/assets/6712823/24d38662-1936-4f31-995e-439d1c3d7af3

Diagnostics ID
4635bd23-3671-4ca9-9171-2adeaeb9f75d

Same problem here

same problem

Looks like auth method we are currently using changed or is dead now, it returns 403. I definitely won't have time completely reimplementing auth for this plugin in near future so if somebody else could look into it that would be super helpful.

Quick goolging showed that it looks like this Python project implements auth method used by Xbox mobile app, probably good idea to start there: https://github.com/OpenXbox/xbox-webapi-python

Same issue here on a new install

Same issue for me too.

Same problem here .... No authentification possible ....

Please stop with "same issues" posts. We know that it's broken and why, as I said in my previous message. These posts only spam my inbox.

Fixed in 2.13 update

Hi, @JosefNemec. While the Authentication issue seems to be fixed on update 2.13, it seems to require reauthentication after 24 hours. There's a 400 error when refreshing the Auth token after 24 hours. This is the log:

06-12 11:21:21.449|DEBUG|XboxLibrary#XboxAccountClient:Refreshing xbox tokens.
06-12 11:21:21.840|ERROR|XboxLibrary#XboxLibrary:Failed to Xbox profile titles.
System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at XboxLibrary.Services.XboxAccountClient.d__12.MoveNext() in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\Services\XboxAccountClient.cs:line 178
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at XboxLibrary.Services.XboxAccountClient.d__11.MoveNext() in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\Services\XboxAccountClient.cs:line 168
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at XboxLibrary.Services.XboxAccountClient.d__14.MoveNext() in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\Services\XboxAccountClient.cs:line 241
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at XboxLibrary.Services.XboxAccountClient.d__15.MoveNext() in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\Services\XboxAccountClient.cs:line 263
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at XboxLibrary.XboxLibrary.GetGames(LibraryGetGamesArgs args) in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\XboxLibrary.cs:line 193
06-12 11:21:24.279|ERROR|XboxLibrary#XboxLibrary:Failed to get info about installed UWP package Microsoft.XboxSpeechToTextOverlay_8wekyb3d8bbwe.
System.Exception: User is not authenticated.
at XboxLibrary.Services.XboxAccountClient.d__17.MoveNext() in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\Services\XboxAccountClient.cs:line 358
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at XboxLibrary.XboxLibrary.GetGames(LibraryGetGamesArgs args) in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\XboxLibrary.cs:line 246
06-12 11:21:25.295|ERROR|XboxLibrary#XboxLibrary:Failed to get info about installed UWP package Microsoft.SecHealthUI_8wekyb3d8bbwe.
System.Exception: User is not authenticated.
at XboxLibrary.Services.XboxAccountClient.d__17.MoveNext() in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\Services\XboxAccountClient.cs:line 358
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at XboxLibrary.XboxLibrary.GetGames(LibraryGetGamesArgs args) in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\XboxLibrary.cs:line 246
06-12 11:21:26.342|ERROR|XboxLibrary#XboxLibrary:Failed to get info about installed UWP package Microsoft.Winget.Source_8wekyb3d8bbwe.
System.Exception: User is not authenticated.
at XboxLibrary.Services.XboxAccountClient.d__17.MoveNext() in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\Services\XboxAccountClient.cs:line 358
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at XboxLibrary.XboxLibrary.GetGames(LibraryGetGamesArgs args) in C:\Devel\PlayniteExtensions\source\Libraries\XboxLibrary\XboxLibrary.cs:line 246
06-12 11:21:26.342|DEBUG|XboxLibrary#XboxLibrary:Found 8 installed Xbox games.

Should I create a separate issue about this?

I still have this issue for some reason, latest version 10.32

Encountering this issue on 10.33. I enter my login info and then the authentication screen goes blank and then never closes.