I have followed the facebook developer tutorial in order to do this to no avail.
Basically I need user to authorize my app from within a page tab.
I have used their recommended javascript to redirect the user on page load to redirect them to the oauth popup however when the app loads I just get the dreaded "sorry an error occurred"
The URL that is generated is "https://www.facebook.com/dialog/oauth/?client_id=247274355370447&redirect_uri=https%3A%2F%2Fwww.facebook.com%2Fpages%2Fnull%2F286793781401206%2F247274355370447&scope=email,user_about_me" so I can see my variables for both page_id and app_id are being passed in.
Here is my complete JS code
<script>
var oauth_url = 'https://www.facebook.com/dialog/oauth/';
oauth_url += '?client_id=<? echo $app_id;?>';
oauth_url += '&redirect_uri=' + encodeURIComponent('https://www.facebook.com/pages/null/<?php echo $page_id;?>/<?php echo $app_id;?>');
oauth_url += '&scope=email,user_about_me'
window.top.location = oauth_url;
</script>