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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:52:04+00:00 2026-05-27T23:52:04+00:00

I am building a helper class that would allow me to manage facebook account

  • 0

I am building a helper class that would allow me to manage facebook account in a windows form application. I am using Facebook C# SDK. As it is suggested in its documentation, to know if the user is authenticated one would get the loginUrl

       var loginUrl = oauth.GetLoginUrl(parameters);

and then afterward, navigate to that Url

webBrowser.Navigate(loginUrl);

Since I am on the back end of the application, I wonder how one can write a helper class that will return true or false to show if the user is authenticated or not. I would love to do something like:

public static  bool IsUserAunthenticated (string appId, string[] extendedPermissions)

How can this function be written? Any ideas? Remember I am using windows form on .net 4.0

  • 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-27T23:52:04+00:00Added an answer on May 27, 2026 at 11:52 pm

    assuming this function is called some time after

    webBrowser.Navigate(loginURL)
    

    A solution like this could work:

    assuming:

    • The user has already authorized your application
    • ‘facebookClient’ is a static class field is already initialized

      public static bool isUserAuthenticated()  {
      try
      {
          facebookClient.Get("/me");
      
          //the lack of an exception thrown is a sign of success
          return true;
      }
      catch (FacebookOAuthException e)
      {
          //your access token used to initialize 'facebookClient' is invalid
          return false;
      } }
      

    Some general notes:

    • you didn’t show any code to handle the retrieval of the actual access
      token. I’ve been assuming you left that out for brevity.

    • passing in ‘appID’ and ‘extendedPermissions’ means that this method
      would be used to REGISTER the user, not for testing to see if they
      were already a user of your application.

    • related to the above point, you could pass in the access token as an
      argument so you would be able to initialize ‘facebookClient’ inside
      the method and run the authentication test.

    To sum that last little bit up, if you’re not already aware, you need to realize there are two distinct stages: getting the access token and using the access token.

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

Sidebar

Related Questions

I'm building a class project (seperate dll) that will contain various helper methods and
building a site using PHP and MySQL that needs to store a lot of
I am building a helper object that has a property called Mailer. In reality
Building a custom adminhtml module. Im using a simple form. it looks like this
In my MVC application, I have a helper class designed to render a group
I'm trying to write a helper method to simplify building forms using Bootstrap Twitter.
I am building a custom HTML.LabelFor helper that looks like this : public static
I am creating a BHO using helloworld sample. Building Browser Helper Objects with Visual
I'm building an application that is multi-lingual, multi-timezoned and n-tier. All dates are stored
I'm building a hierarchical collection class that orders magnetic resonance images spatially and arranges

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.