Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $scope = "email%20identify";
- $redirect_uri = "https://www.yumenetwork.fr/ok.php";
- $discord_login_url = "https://discordapp.com/api/oauth2/authorize?client_id=" . $client_id . "&redirect_uri=" . $redirect_uri . "&response_type=code&scope=" . $scope;
- $discord_token_url = "https://discordapp.com/api/oauth2/token";
- $code = $_GET['code'];
- $data = http_build_query(array(
- 'client_id' => $client_id,
- 'client_secret' => $client_secret,
- 'grant_type' => 'authorization_code',
- 'code' => $code,
- 'redirect_uri' => $redirect_uri,
- 'scope' => $scope
- ));
- $options = array(
- 'http' => array(
- 'header' => "Content-type: application/x-www-form-urlencoded",
- 'method' => 'POST',
- 'content' => $data
- )
- );
- $context = stream_context_create($options);
- $result = file_get_contents($discord_token_url, false, $context);
- var_dump($result);
Advertisement
Add Comment
Please, Sign In to add comment