Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When trying to use xbox-authenticate I get these errors: #101

Open
Openiv opened this issue Dec 10, 2023 · 1 comment
Open

When trying to use xbox-authenticate I get these errors: #101

Openiv opened this issue Dec 10, 2023 · 1 comment

Comments

@Openiv
Copy link

Openiv commented Dec 10, 2023

C:\Users\perso>xbox-authenticate
Serving HTTP Server for auth callback at port 8080
Exception in thread Thread-1 (serve_forever):
Traceback (most recent call last):
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1052, in _bootstrap_inner
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Scripts\xbox-authenticate.exe_main
.py", line 7, in
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\site-packages\xbox\webapi\scripts\authenticate.py", line 154, in main
asyncio.run(async_main())
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
self.run()
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 989, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\socketserver.py", line 235, in serve_forever
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
ready = selector.select(poll_interval)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\selectors.py", line 323, in select
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\site-packages\xbox\webapi\scripts\authenticate.py", line 148, in async_main
await do_auth(
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\site-packages\xbox\webapi\scripts\authenticate.py", line 86, in do_auth
await auth_mgr.refresh_tokens()
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\site-packages\xbox\webapi\authentication\manager.py", line 77, in refresh_tokens
r, w, _ = self._select(self._readers, self._writers, [], timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\selectors.py", line 314, in _select
r, w, x = select.select(r, w, w, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 10038] An operation was attempted on something that is not a socket
self.oauth = await self.refresh_oauth_token()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\site-packages\xbox\webapi\authentication\manager.py", line 96, in refresh_oauth_token
return await self._oauth2_token_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\site-packages\xbox\webapi\authentication\manager.py", line 112, in _oauth2_token_request
resp.raise_for_status()
File "C:\Users\perso\AppData\Local\Programs\Python\Python312\Lib\site-packages\httpx_models.py", line 758, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx._exceptions.HTTPStatusError: Client error '400 Bad Request' for url 'https://login.live.com/oauth20_token.srf'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400

@Sat727
Copy link

Sat727 commented May 2, 2024

I just found out what's wrong. For some reason, it's grabbing the wrong client ID, I defined it before requesting to refresh the token. auth_mgr._client_id = "CLIENT ID HERE" then execute the refresh_tokens() function. Not sure what causes this, but I guess be sure to overwrite whatever the client ID it has gotten. This worked in my case, if you can figure out what causes this post, or if I find anything else out I'll post here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants