PHP

Search Knowledge Base by Keyword

Contents

Required PHP version is 5, required modules: curl.
The library can be downloaded at https://passport.winkk.com/partner/example/eye_oauth.php

<?php

  require("eye_oauth.php");

  // Application ID from the step 13
  $client_id = "5953a9af05a1462e9c66a123";
  // Secret key from the step 13
  $secret = "secret_word";

  $oauth = new EyeOAUTH2($client_id, $secret);
  $p = $oauth->profile();
  if ($p === false) die("Error:".$oauth->last_error());

  // $p variable contains profile data
  print_r($p);

  // Greet the client
  print "Hello ".$p['personal.first_name'];
  print "user_id: ".$p['id'];

  // Avatar
  file_put_contents("av.bin", base64_decode($p['personal.avatar']));
  print "<img src='av.bin' />";

?>
Was this article helpful?
How can we improve this article?

Leave a Reply

Your email address will not be published. Required fields are marked *