php - facebook js signed_request -
i using facebook js allow user's login. login part on js works want catch signed_request facebook sends (with use of server-side language such php or java). reading documentation (https://developers.facebook.com/docs/facebook-login/using-login-with-games/) on how catch signed_requests not informative. state "the signed request sent via http post url set canvas url", went exact url (mywebsitenamehere.com/login.php stated canvas url , added code catch post['signed_request'] (i assume it, can't find anywhere on facebook tells name of variable). problem nothing happens, added code in login.php page redirect website if post variable set testing purposes, , nothing happens. appreciate concrete example of supposed do. searching internet able find examples, people using php login, using js.
it´s in text of link posted:
"when run game on facebook.com, can access signed request parameter"
so, signed_request available in canvas apps through canvas url on facebook: https://apps.facebook.com/appnamespace
...or in page apps, of course. put in own server url corretly, need set app namespace , own server url loaded in iframe @ apps.facebook.com/appnamespace.
that being said, can use php sdk data out of ($facebook->getsignedrequest()), or function presented in link (parse_signed_request).
edit: cannot access signed_request directly in javascript, echo server language. example (not tested, idea):
<script> var signed_request = '<?php echo json_encode($signed_request); ?>'; </script>
Comments
Post a Comment