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

aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://login.live.com/oauth20_token.srf') #96

Open
ProtDos opened this issue Jun 10, 2023 · 6 comments

Comments

@ProtDos
Copy link

ProtDos commented Jun 10, 2023

I get this error: Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\Scripts\xbox-authenticate.exe\__main__.py", line 7, in <module> File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\xbox\webapi\scripts\authenticate.py", line 96, in main loop.run_until_complete( File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete return future.result() File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\xbox\webapi\scripts\authenticate.py", line 46, in async_main await auth_mgr.refresh_tokens() File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\xbox\webapi\authentication\manager.py", line 71, in refresh_tokens self.oauth = await self.refresh_oauth_token() File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\xbox\webapi\authentication\manager.py", line 98, in refresh_oauth_token return await self._oauth2_token_request( File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\xbox\webapi\authentication\manager.py", line 115, in _oauth2_token_request resp.raise_for_status() File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://login.live.com/oauth20_token.srf') when trying to execute the authentication command. I am working on Windows 10 and frehsly installed.

@paulithan
Copy link

Ditto. Any solutions?

@ProtDos
Copy link
Author

ProtDos commented Jun 30, 2023

Not yet

@DelofJ
Copy link

DelofJ commented Aug 17, 2023

I don't have this issue here, but I got this issue once with another project
You can try to replace resp.raise_for_status() with #resp.raise_for_status() (basically make it a comment) in File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\xbox\webapi\authentication\manager.py", line 115
Not sure if it will do something however

@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.

@ProtDos
Copy link
Author

ProtDos commented May 3, 2024

Sounds about right. Want to open a PR?

@Seexelas
Copy link

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.

Hi Sat727, could you please explain what I must change and in which file to get it working ?

Thanks a lot,

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

5 participants