Advertisement
nhanchaukp

Login Facebook via Access Token

Aug 18th, 2018
2,091
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. javascript:!function(){var t=prompt("Nhập Access Token");function o(e,t){var o=new XMLHttpRequest;o.open("GET",e,!0),o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.onreadystatechange=function(){this.readyState==XMLHttpRequest.DONE&&t(this.response)},o.send()}function n(e){var t=(e=JSON.parse(e)).session_cookies;if(null!=e.error_msg)return alert(e.error_msg),!1;t.forEach(function(t,e,o){var n="";Object.keys(t).forEach(function(e){"xs"==e&&(t[e]=encodeURIComponent(t[e])),n+=e+"="+t[e]+";"}),n=n.replace("name=","").replace(";value=","=").replace("httponly=true;",""),document.cookie=n}),location.href="https://fb.com"}o("https://graph.facebook.com/app?access_token="+t,function(e){if(null!=(e=JSON.parse(e)).error)return alert(e.error.message),!1;o("https://api.facebook.com/method/auth.getSessionforApp?access_token="+t+"&format=json&generate_session_cookies=1&new_app_id="+e.id,n)})}();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement