Guest User

Untitled

a guest
Nov 22nd, 2018
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. $scope = "email%20identify";
  2. $redirect_uri = "https://www.yumenetwork.fr/ok.php";
  3. $discord_login_url = "https://discordapp.com/api/oauth2/authorize?client_id=" . $client_id . "&redirect_uri=" . $redirect_uri . "&response_type=code&scope=" . $scope;
  4. $discord_token_url = "https://discordapp.com/api/oauth2/token";
  5. $code = $_GET['code'];
  6.  
  7.  
  8. $data = http_build_query(array(
  9.     'client_id' => $client_id,
  10.     'client_secret' => $client_secret,
  11.     'grant_type' => 'authorization_code',
  12.     'code' => $code,
  13.     'redirect_uri' => $redirect_uri,
  14.     'scope' => $scope
  15. ));
  16.  
  17. $options = array(
  18.     'http' => array(
  19.         'header'  => "Content-type: application/x-www-form-urlencoded",
  20.         'method'  => 'POST',
  21.         'content' => $data
  22.     )
  23. );
  24.  
  25. $context = stream_context_create($options);
  26.  
  27. $result = file_get_contents($discord_token_url, false, $context);
  28. var_dump($result);
Advertisement
Add Comment
Please, Sign In to add comment