I am using FB.ui to authorize with application Facebook tab using simple:
FB.init({
appId : '<%= Facebook::APP_ID %>',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
channelUrl : 'http://<%= request.host_with_port %>/channel.html', // Custom Channel URL
oauth : true //enables OAuth 2.0
});
FB.ui({
method: 'oauth'
},
function(response) {
// do some redirect stuff here
});
Authorization goes fine, but even when user confirms the application, the relevant fbsr_xxxxx cookie is not set. Is there any way to force it? Response object contains user_id, but I would rather use the standard flow with signed_request.
I’m having the exact same issue. There seems to be no way to get the access token without refreshing the page other than using FB.login, which pops out a new window.
What you may want to do is make an ajax call to another page to return the access token after the FB.ui response: