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

  • Home
  • SEARCH
  • 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 8800885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:42:25+00:00 2026-06-14T00:42:25+00:00

I am using SCRIBE library to enable Facebook connect login in my Application. My

  • 0

I am using SCRIBE library to enable Facebook connect login in my Application. My problem is that after logging in and getting the access_token every time I click on the login button I am signing in without authorization, because I am signed in Facebook and the access_token is still active. Is there a way to force facebook to sign out or every time to ask me for new access_token, is it a good idea to do it with cookie or using connect.facebook.net/en_US/all.js or just redirect it at some point to https://www.facebook.com/logout.php?access_token=appId&confirm=1&next=http://localhost:8080/ . I know there is a lot of questions about that topic, but all of them and suggested solutions confuse me. Here is the my post construct method in the managed bean that handles Facebook response.

@PostConstruct
public void init() {
FacesContext context = FacesContext.getCurrentInstance();
HttpServletRequest req = (HttpServletRequest) context
.getExternalContext().getRequest();

    responseCode = req.getParameter("code");
    System.out.println("The code is:   "+responseCode);


    //facebook data
    final String PROTECTED_RESOURCE_URL = "https://graph.facebook.com/me";
    final Token EMPTY_TOKEN = null;
    String apiKey = "MY_API_KEY";
    String apiSecret = "MY_API_SECRET";
    String callbackUrl="the-redirect_page_in_my_application";

    OAuthService service = new ServiceBuilder().provider(FacebookApi.class)
            .apiKey(apiKey).apiSecret(apiSecret)
            //.scope(SCOPE)
            .callback(callbackUrl).build();

    //get authorization Url
    String authorizationUrl = service.getAuthorizationUrl(EMPTY_TOKEN);

    Verifier v=new Verifier(responseCode);
    Token accessToken = service.getAccessToken(EMPTY_TOKEN, v);


    // Now let's go and ask for a protected resource!

    OAuthRequest request = new OAuthRequest(Verb.GET,
            PROTECTED_RESOURCE_URL);
    service.signRequest(accessToken, request);
    Response response = request.send();


    Gson gson = new GsonBuilder().create();
    FacebookUser faceUser = gson.fromJson(response.getBody(), FacebookUser.class);

    setUserName(faceUser.getName());
    setUserFacebook(faceUser.getUsername());
    setGender(faceUser.getGender());

    FacesContext.getCurrentInstance().responseComplete();
    }
  • 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-14T00:42:26+00:00Added an answer on June 14, 2026 at 12:42 am

    You have multiple options:

    1. Tie your Logout button to the Facebook Javascript SDK’s
      FB.logout()
      function.
      This has a possibly unwanted side-effect of logging the
      user out of Facebook.com also (because your app might have been
      responsible for them logging into it in the first place)
    2. Use the /me/permissions Graph API endpoint with an HTTP DELETE and a user access token to revoke permissions for that user for your app. The downside here is that the user will have to re-authenticate again when they login to your app the next time (and see the Login Dialog again too).
    3. Store a session variable that tells you that someone is logged in. Delete that variable when they logout and store another session variable that indicates they have manually logged out. Then if that second variable exists, do not automatically re-authenticate them again until they click on the login button in your app.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a proof-of-concept app to connect to LinkedIn using the scribe OAuth library.
I'm using scribe for logging into LinkedIn in my application. I would like to
I am using Scribe-Java to connect to Google plus using OAuth2. I am able
I am using Java Scribe + Spring MVC to access Facebook authentication API. However,
I'm using scribe for making an app that has oauth support. I didn't found
I plan on running a Facebook Scribe Server on an AWS EC2 providing logging
Is it possible to upload images using Scribe-Java and twitter POST Url https://upload.twitter.com/1/statuses/update_with_media.json? my
I am trying to authenticate linkedin users for my site. I am using Scribe
Using the Qt library, is there a way to automatically update a QDateTimeEdit using
Using System.Diagnostics.EventLog .NET type one can programmatically create logs into the Event Viewer application.

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.