Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $payload = '{
- "client_id": "'.OAUTH2_CLIENT_ID.'",
- "client_secret": "'.OAUTH2_CLIENT_SECRET.'",
- "grant_type": "authorization_code",
- "code": "'.$code.'",
- "redirect_url": "'.$redirect.'",
- "scope": "identify guilds"
- }';
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $token_url);
- curl_setopt($curl, CURLOPT_POST, 1);
- curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode(json_decode($payload)));
- $api_ruser = curl_exec($curl);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement