Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8190545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:41:33+00:00 2026-06-07T03:41:33+00:00

I can do it oldschool: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html

  • 0

I can do it oldschool:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>

    <body>

    <div id="fb-root"></div>
    <script type="text/javascript" src="http://connect.facebook.net/de_DE/all.js"></script>

    <script type="text/javascript">

        function init(){
            FB.init({
                appId  : 'MY_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://MY_WEBSPACE/facebook-iframe/channel.html' // custom channel
            });
            setupApp();
        }

        function setupApp() {

            FB.getLoginStatus(
                function(response) {
                    if (!response.session) {
                        FB.ui({method: "permissions.request", "perms": ''} , getUserId);
                    } else {
                        // the user previously authorized the app
                        getUserId(response);
                        window.location = "fanAuthorized.php";
                    }
                });
            return false;
        }

        function getUserId(data){
            if(data.status !== 'notConnected' || data.session !== null){
                // the user has just authorized the app
                userId = data.session.uid;
                accessToken = data.session.access_token;
                window.location = "fanAuthorized.php";
            } else {
                // the user has just denied to authorize the app
                window.location = "fanUnauthorized.php";
            }
        }

        init();

    </script>

</body>

</html>

Switching to OAuth 2 gets me stuck. I tried the following:

<!DOCTYPE html> 
<html xmlns:fb="https://www.facebook.com/2008/fbml">
    <head> 
    </head> 
<body>

    <div id="fb-root"></div>

    <script>
    window.fbAsyncInit = function() {
        FB.init({ appId: 'MY_APP_ID', 
            status: true, 
            cookie: true,
            xfbml: true,
            oauth: true
        });

        function updatePage(response) {

            if (response.authResponse) {
                // user is already logged in and connected
                window.location = "fanAuthorized.php";
            } else {
                // user is not connected or logged out
                FB.login(function(response) {
                    if (response.authResponse) {
                        window.location = "fanAuthorized.php";
                    } else {
                        // user has just cancelled login or denied permission
                        window.location = "fanUnauthorized.php";
                    }
                }, {scope:''}); 
            }
        }

        // run once with current status and whenever the status changes
        FB.getLoginStatus(updatePage);
        FB.Event.subscribe('auth.statusChange', updatePage);    
    };

    (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol 
        + '//connect.facebook.net/de_DE/all.js';
        document.getElementById('fb-root').appendChild(e);
    }());

    </script>

</body> 
</html>

This code turns my modal dialog authorization into a popup dialogue authorization and without user interaction the popup gets blocked by the browser. I would like the authorization dialogue come up unblocked without user interaction and stay on the current page (my facebook fanpage). Is there a way to do that? Thanks in advance!

UPDATE:

Seems I’ve managed to implement the authorization dialog the non-pop-up-way. The authorization dialog opens without user interaction in the same window (not as a modal dialog) and doesn’t get blocked by the browser. After the user has authorized the app he gets redirected to the same tab in the facebook fanpage iframe where he just came from. The app then recognizes that the user is connected. If the user cancels the authorization he gets redirected to the wall of the fanpage. And now the code:

fanPage.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>

    <!-- Initialize Facebook authorization dialogue -->
    <?php $app_id = "MY_APP_ID"; ?>

    <div id="fb-root"></div>
    <script type="text/javascript" src="http://connect.facebook.net/de_DE/all.js"></script>

    <script type="text/javascript">
        <!--

        function init(){
            FB.init({
                appId  : '<?php echo $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://MY_WEBSPACE/facebook-iframe/channel.html', // custom channel
                oauth  : true // enable OAuth
            });

            FB.getLoginStatus(function(response) {
                if (response.status !== 'connected') {

                    var api_key = "<?php echo $app_id; ?>";
                    var canvas_page = escape("http://apps.facebook.com/MY_APP/");

                    var redirect = 'https://www.facebook.com/login.php?api_key=' + api_key
                        + '&extern=1&fbconnect=1&v=1.0'
                        + '&next=' + canvas_page + 'fanAuthorized.php'
                        + '&cancel_url=' + canvas_page + 'fanUnauthorized.php';
                    self.parent.location = redirect;
                } else {
                    window.alert("You are connected!");
                }
            });
        }

        init();

        //-->
    </script>

</body>

</html>

fanUnauthorized.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

</head>

    <script type="text/javascript">
        <!--
            top.location.href='http://www.facebook.com/pages/MY_FANPAGE_NAME/MY_FANPAGE_ID';
        //-->
    </script>

<body>
</body>
</html>

fanAuthorized.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

    <script type="text/javascript">
        <!--
            top.location.href='http://www.facebook.com/pages/MY_PAGE_NAME/MY_PAGE_ID?sk=app_MY_APP_ID;
        //-->
    </script>

<body>
</body>
</html>

and if you are wondering what the channel.html is all about – here it is:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US">
    <head>
        <title> </title>
    </head>
    <body>
        <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
    </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:41:37+00:00Added an answer on June 7, 2026 at 3:41 am

    I updated my question already a while ago. By now I am quite certain that there is no way to show the authorization dialog in a modal layer anymore by using FB.ui, JQueryUI Dialog or anything similar.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I change the field public virtual ClassOne ClassOne { get; set; } to
Can some one explain to me why the GetProperties method would not return public
Can anyone let me know how can we change the value of kendo combobox
Can I order my users in the database, so I don't have to say
Can I authenticate with just Google account username and password instead of using OAuth?
Can any one tell, how to get the result of LINQ query contains group
Can we change the default action of the edit selected row button? Here is
Can someone thoroughly explain the last line of the following code: def myMethod(self): #
Can anyone enlighten me to a way I can Highlight the content of an
Can I be sure about the order in a Python dictionary? The function op.GetTangent(id)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.