Facebook Login Iframe

I'm trying to login Facebook through an Iframe in an app developed in IntelXDK. The problem is that the page go outside of the Iframe. In the app i've

<iframe style="overflow:hidden;height:100%;width:100%; position:fixed; margin-left:-10px;" height="100%" width="100%" frameborder="0" src="http://...."></iframe>   

while in my page i've this:

 var paramsLocation=window.location.toString().indexOf('?');
  var params="";
  if (paramsLocation>=0)
    params=window.location.toString().slice(paramsLocation);

top.location = 'https://graph.facebook.com/oauth/authorize?client_id=MYID&redirect_uri=http://MYURL';

How can I obtain to stay in the Iframe after facebook login?

Answers


You have to use Cordova InAppBrowser to do facebook login in HTML5 packaged app, you can use this jquery plugin to login to facebook oauth:

https://github.com/krisrak/jquery-cordova-oauth2

$.oauth2({
    auth_url: 'https://www.facebook.com/dialog/oauth',
    response_type: 'token',
    client_id: 'CLIENT-ID-FROM-FACEBOOK',
    redirect_uri: 'http://www.yourwebsite.com/oauth2callback',
    other_params: {scope: 'basic_info', display: 'popup'}
}, function(token, response){
    makeAPICalls(token);
}, function(error, response){
    alert(error);
});

This is will work in IntelXDK


Need Your Help

Having Issue on Over Writing Bootstrap 3 Breadcrumbs Separator

twitter-bootstrap twitter-bootstrap-3

I am trying to change the Bootstrap 3 Breadcrumbs Separator from / to glyphicon glyphicon-arrow-right by using the following rule