Advertisement
nathan66669

BandAuthorization

Feb 13th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4. header("Content-Type: application/json");
  5.  
  6. if (!isset($_GET["key"])) {
  7.     echo '{"access_denied": "No "Key" parameter"}';
  8.     exit();
  9. }
  10.  
  11. if ($_GET["key"] == "ABC123") {
  12.     if (isset($_GET["tag"])) {
  13.         $access_token = "ZQAAAV6_P0s91qJHYoCz_QpKMUZZuC8_Tnp1r5_KbnJUeXOxxKbMyHVpysVj0bkvl3sq6jK2J2QDqwLBMZ7Dz1hwRxeIgTlXr9TIBAei6aCfOcJW";
  14.     $Client Secret = "dXfFK2WDKbqvq1x0_F1kT9kub2hALrRP";
  15.     $client_id = "228534290";
  16.     $redirect_uri = "http://sample-env.5fphmhwmwf.us-west-2.elasticbeanstalk.com";
  17.         $headers = array("Authorization: Bearer " . $access_token);
  18.  
  19.         // Initiate connection with API
  20.         $ch = curl_init("https://auth.band.us/oauth2/authorize?response_type=code&client_id=" .$client_id. "&redirect_uri=" .$redirect_uri);
  21.         // Set the Authorization header
  22.         //curl_setopt($ch, CURLOPT_HTTPHEADER);
  23.         // Execute the request (which also echo's it to the user)
  24.         curl_exec($ch);
  25.         // Close request
  26.         curl_close($ch);
  27.     } else {
  28.         echo '{"error": "No "tag" parameter!"}';
  29.     }
  30. } else {
  31.     echo '{"access_denied": "Incorrect Key"}';
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement