誰かがより明確な答えを探している場合:
PHPでこれを行う方法は次のとおりです。
$authorizeUrl = 'https://ssl.reddit.com/api/v1/access_token';
$clientId = "YOUR_CLIENT_ID";
$clientSecret = "YOUR_CLIENT_SECRET";
$post = array(
"client_id" => $clientId,
"client_secret" => $clientSecret,
"grant_type" => "refresh_token",
"refresh_token" => "STORED_REFRESH_TOKEN_VALUE",
"scope" => "identity",
"state" => "WHATEVER_VALUE",
"duration" => "temporary",
"redirect_uri" => "https://example.com/reddit",
);
$payload = http_build_query($post);
$ch = curl_init($authorizeUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_USERPWD, $clientId . ":" . $clientSecret);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
print_r($result);