22.03.2017 - You have to use FB.login to authorize users: document.getElementById('test').addEventListener('click', function() { //do the login .