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

So I'm creating a site where users must login. If the user wishes that
I am creating a facebook application in asp.net. I want that when user login
So I'm creating a login form.Validating user input to check whether the email format
I am creating login pages using asp.net with code behind in vb.net, I am
I am creating a login menu in C++ i wish to give the user
I'm currently creating a Login form and have this code: string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
I'm creating an app where user needs to login first and only after that
I have written a code for a login page and user page. When the
Without creating a session, I want to check the validity of a login/pw. How
I am creating a user login and changing the link of signin to signout

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.