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 3439948
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:22:24+00:00 2026-05-18T08:22:24+00:00

i am creating login code for facebook connect on our site, however i cannot

  • 0

i am creating login code for facebook connect on our site,
however i cannot find how to check if the user has the required permissions.

with the old javascript, one dialog would be opened for each permission and the return code would say if the permission was accepted or not, how does it work with the javascript code?

here is the code i got so far, with the TODO where i want to check if the user has got permissions

   <div id="fb-root"></div>
   <script>
   window.fbAsyncInit = function() {
    FB.init({appId: 'MY API KEY', status: true, cookie: true,xfbml: true});
    FB.Event.subscribe('auth.login', function(response) {
        alert("logged in");

        //TODO: check if all perms has been accepted!!!!
        //if they have NOT been accepted, I want to logout the user
    });

    FB.getLoginStatus(function(response) {

         if (response.session) {    
            // logged in and connected user, again, check if all perms has been accepted
            alert("already logged in");    
         }

     });


  };
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
</script>
<fb:login-button perms="email,user_birthday,status_update,publish_stream" >Login with Facebook</fb:login-button>

btw, in the documentation they have this example
http://developers.facebook.com/docs/reference/javascript/FB.login

where they use custom buttons, that’s why i suspected that there would be something similar for the fb:loginbutton

  • 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-05-18T08:22:24+00:00Added an answer on May 18, 2026 at 8:22 am
    FB.Event.subscribe('auth.login',function(response) {
       if(response.session) { //checks if session is true
          alert('logged in');
    
          if(response.perms) { //checks if perms is true = permissions are granted
             alert('perms granted');
          }
          else { //if perms is false = no permissions granted
             alert('no perms');
          }
       }
       else { //if something goes wrong
          alert('login failure');
       }
    });

    Original Facebook guide:
    http://developers.facebook.com/docs/reference/javascript/FB.login

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

Sidebar

Related Questions

I'm creating a login page. I want to create ASP.NET TextBox controls that have
I'm creating a control and need to pass it the current logon user as
When creating a web application, and lets say you have a User object denoting
While creating classes in Java I often find myself creating instance-level collections that I
I am new to creating a facebook application and hence started out with a
Creating a patch is very easy in SubVersion, With Tortoise, you right-click and select
Creating hashes of hashes in Ruby allows for convenient two (or more) dimensional lookups.
Creating Traversals for Binary Search Tree with Recursion. void inOrder(void (*inOrderPtr)(T&)) { if(this->left !=
Creating an XPathDocument with referenced DTD sometimes throws a web exception. Why?
While creating a file synchronization program in C# I tried to make a method

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.