kakatoji

mengambil securetoken googleapis

Sep 20th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. function newuser($key){
  5. $url="https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=$key";
  6. $h[]="Content-Type: application/json";
  7. $h[]="User-Agent: Mozilla 5.0 (Linux; U; Android 7.0; in_ID; Redmi Note 4; Build/NRD90M); com.google.android.gms/203019021; FastParser/1.1; ApiaryHttpClient/1.0; (gzip) (mido NRD90M); gzip";
  8. $h[]="Host: www.googleapis.com";
  9. $ch=curl_init();
  10. curl_setopt_array($ch, array(
  11. CURLOPT_URL => $url,
  12. CURLOPT_RETURNTRANSFER => TRUE,
  13. CURLOPT_FOLLOWLOCATION => TRUE,
  14. CURLOPT_CUSTOMREQUEST => "POST",
  15. CURLOPT_HTTPHEADER => $h,
  16. CURLOPT_SSL_VERIFYPEER => 0,
  17. CURLOPT_COOKIEJAR => "OYA",
  18. CURLOPT_COOKIEFILE => "OYA",
  19. CURLOPT_COOKIESESSION => TRUE,
  20. CURLOPT_ENCODING => "gzip",
  21. ));
  22. return curl_exec($ch);
  23. curl_close($ch);
  24. }
  25.  
  26. function token($key,$post){
  27. $url="https://securetoken.googleapis.com/v1/token?key=$key";
  28. $h[]="Content-Type: application/x-www-form-urlencoded";
  29. $h[]="User-Agent: Mozilla 5.0 (Linux; U; Android 7.0; in_ID; Redmi Note 4; Build/NRD90M); com.google.android.gms/203019021; FastParser/1.1; ApiaryHttpClient/1.0; (gzip) (mido NRD90M); gzip";
  30. $h[]="Host: securetoken.googleapis.com";
  31. $ch=curl_init();
  32. curl_setopt_array($ch, array(
  33. CURLOPT_URL => $url,
  34. CURLOPT_RETURNTRANSFER => TRUE,
  35. CURLOPT_FOLLOWLOCATION => TRUE,
  36. CURLOPT_CUSTOMREQUEST => "POST",
  37. CURLOPT_HTTPHEADER => $h,
  38. CURLOPT_SSL_VERIFYPEER => 0,
  39. CURLOPT_POSTFIELDS => $post,
  40. CURLOPT_COOKIEJAR => "OYA",
  41. CURLOPT_COOKIEFILE => "OYA",
  42. CURLOPT_COOKIESESSION => TRUE,
  43. #CURLOPT_ENCODING => "gzip",
  44. ));
  45. return curl_exec($ch);
  46. curl_close($ch);
  47. }
  48.  
  49.  
  50. $key="AIzaSyARAeW-k03xDLTl0oLOTMd0Nwby3r9Tq8Y";
  51. $new=json_decode(newuser($key),true);
  52. $data="grant_type=refresh_token&refresh_token=".$new['refreshToken'];
  53. $scret=json_decode(token($key,$data));
  54. print_r($scret);
Add Comment
Please, Sign In to add comment