My facebook app is getting redirected out of the iFrame on authorization. I have used the facebook.php and base_facebook.php from gitHub without any change and have pretty much followed example.php. What could I be missing?:
- $facebook = new Facebook(array(
- 'appId' => $configParam['appId'],
- 'secret' => $configParam['secret']
- ));
- $appId=$configParam['appId'];
- $user = $facebook->getUser();
- if ($user==null) {
- $loginUrl = $facebook->getLoginUrl(array(
- 'scope' => $perm
- ));
- $loginUrl = $facebook->getLoginUrl();
- echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
- }
The loginUrl is constructed in base_facebook.php as:
- $this->establishCSRFTokenState();
- $currentUrl = $this->getCurrentUrl();
- return $this->getUrl(
- 'www',
- 'dialog/oauth',
- array_merge(array(
- 'client_id' => $this->getAppId(),
- 'redirect_uri' => $currentUrl, // possibly overwritten
- 'state' => $this->state),
- $params));