I am using the jQuery library for authenticating the user, using this script:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
// Initialize the library with the API key
FB.init({ apiKey: 'SECRET_KEY' });
// Fetch the status on load
FB.getLoginStatus(handleSessionResponse);
dojo.connect(dojo.byId('login'), 'click', function() {
FB.login(handleSessionResponse);
});
dojo.connect(dojo.byId('logout'), 'click', function() {
FB.logout(handleSessionResponse);
});
dojo.connect(dojo.byId('disconnect'), 'click', function() {
FB.api({ method: 'Auth.revokeAuthorization' }, function(response) {
clearDisplay();
});
});
It is showing
An error has occured please try again. followed by an OK button.
When I click that OK button it says:
Sorry, something went wrong.
We’re working on getting this fixed as soon as we can.
From the documentation for the JavaScript SDK:
You can see that your secret key is not needed, as the JavaScript is available for anyone to read. Facebook’s authentication uses the domain of your request to verify that it is, in fact, your application.