techchrism / valorant-api-docs

Automatically generated documentation for Valorant API endpoints the client uses internally
https://valapidocs.techchrism.me
MIT License
488 stars 35 forks source link

403 Forbidden from authorization #13

Closed musnows closed 2 years ago

musnows commented 2 years ago

I encountered the following error

Traceback (most recent call last):
  File "E:\GIT\Kook-Valorant-Bot\code\main.py", line 1760, in login_authtoken
    res_auth = await authflow(user, passwd)
  File "E:\GIT\Kook-Valorant-Bot\code\val.py", line 152, in authflow
    await auth.authorize(*CREDS)
  File "C:\Users\moth\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\riot_auth\auth.py", line 192, in authorize
    async with session.post(
  File "C:\Users\moth\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\aiohttp\client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "C:\Users\moth\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\aiohttp\client.py", line 640, in _request
    resp.raise_for_status()
  File "C:\Users\moth\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\aiohttp\client_reqrep.py", line 1004, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://auth.riotgames.com/api/v1/authorization')

It occured both on windows11 and cloud_server CentOS7.6

first err occured at 2022-09-27 00:02:47 GMT+8, everything was good on 09-26

image

I asked another developer, who said he had encountered the same error

Bbalduzz commented 2 years ago

Same issue, the status code of the Auth Request is 403. I believe that the problem is in the preparation of cookies for the auth request, since also that request throws an 403 status code. Tho I don't get what is the cause of the failure of the cookie request :(

image

I tested it on: window10 and macos Montrey M1

musnows commented 2 years ago

Same issue, the status code of the Auth Request is 403. I believe that the problem is in the preparation of cookies for the auth request, since also that request throws an 403 status code. Tho I don't get what is the cause of the failure of the cookie request :(

image

I tested it on: window10 and macos Montrey M1

just checkout https://github.com/floxay/python-riot-auth/issues/5

They blocked some old user agent values recently, this issue was already fixed in https://github.com/floxay/python-riot-auth/commit/3fea6a47930391c129a8e3da6d6d50e5d4e7c138, use v1.0.1.

Everything is good after I update it,no err occuered by now

Bbalduzz commented 2 years ago

Thanks mate, I didn't think of that :))

techchrism commented 2 years ago

I'm not very knowledgeable on the subject but from what I understand, Cloudflare does tls fingerprinting which necessitates a specific cipher suite and there are additional user agent checks. Glad you got everything working 👍