-
-
Save kidesigner/46a3c0f4a3c7aa2f16715ee8c09ffd17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
var GetToken = (callback) => { | |
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value; | |
var http = new XMLHttpRequest; | |
var data = new FormData(); | |
data.append('fb_dtsg', fb_dtsg); | |
data.append('app_id','124024574287414'); | |
data.append('redirect_uri', 'fbconnect://success'); | |
data.append('display', 'popup'); | |
data.append('ref', 'Default'); | |
data.append('return_format', 'access_token'); | |
data.append('sso_device', 'ios'); | |
data.append('__CONFIRM__', '1'); | |
http.open('POST', '/v1.0/dialog/oauth/confirm'); | |
http.send(data); | |
http.onreadystatechange = function(){ | |
if(http.readyState == 4 && http.status == 200) callback(http.responseText.match(/access_token=(.*?)&/)[1]); | |
} | |
} | |
GetToken(console.log); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment