I want to open Facebook's oauth dialog in same web page.
I am using Facebooks's JS SDK to perform oauth, display option: popup & touch is working fine but display option: page & iframe is not working.
Code is given below;
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '*************', // App ID
channelUrl : 'file:///D:/channel.htm', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
FB.ui(
{
method: 'oauth',
name: 'Facebook Dialogs',
link: 'http://localhost',
picture: 'http://fbrell.com/f8.jpg',
caption: 'Reference Documentation',
description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
display: 'page'
},
function(response) {
if (response && response.post_id) {
//alert('Post was published.');
} else {
//alert('Post was not published.');
}
}
);
};
</script>
Thanks,