Using the riotgames auth API, I am trying to get my access token and cookies using the following request:
I did use GuzzleHttp\Client for sending request
//for get cookies
$client = new Client();
// Constructing the request body as an array
$requestBody = [
'client_id' => 'play-valorant-web-prod',
'nonce' => '1',
'redirect_uri' => 'https://playvalorant.com/opt_in',
'response_type' => 'token id_token',
'scope' => 'account openid'
];
// Sending a POST request to the specified endpoint
$response = $client->request('POST', 'https://auth.riotgames.com/api/v1/authorization', [
'headers' => [
'Content-Type' => 'application/json',
],
RequestOptions::JSON => $requestBody,
]);
and this for get token
$response = $client->request('PUT', 'https://auth.riotgames.com/api/v1/authorization', [
'headers' => [
'Content-Type' => 'application/json',
],
'json' => [
'type' => 'auth',
'username' => $your_username_variable,
'password' => $your_password_variable,
],
]);
$json = json_decode($response->getBody(), true);
I try to use this package https://github.com/Seaony/laravel-valorant-api and https://valapidocs.techchrism.me/endpoint/auth-cookies
I think the problem has relationship with API key that riot games API give it when create account.