403 Forbidden when trying to authenticate
Closed this issue · 2 comments
NavisGames commented
Because i dont want to use the fix on the old issue, i opend a new issue. Are there already any other fixes already? Is python the reason or generally?
anyway, here is my code:
weird thing is: in insomnia there is everything working fine but not on normal codes
techchrism commented
If the same request (headers, and body) works in Insomnia but not in a program, the problem is likely TLS fingerprinting. Python isn't necessarily the issue, you just need the right TLS fingerprint.
thedtvn commented
@NavisGames pls login use and use Cookie to get that
Ex code but Use aiohttp
async with aiohttp.ClientSession() as s:
async with s.get("https://login.playvalorant.com/") as r:
pass
data = {
'type': 'auth',
'username': username,
'password': password,
"rememberDevice": True
}
async with s.put("https://auth.riotgames.com/api/v1/authorization", json=data, headers=self.headers_main) as r:
out = await r.json()
print(out)
data = {"client_id":"play-valorant-web-prod","nonce":"1","redirect_uri":"https://playvalorant.com/opt_in","response_type":"token id_token", 'scope': 'account openid'}
async with s.post("https://auth.riotgames.com/api/v1/authorization", json=data, headers=self.headers_main) as r:
out = await r.json()
print(out)