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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:49:04+00:00 2026-06-05T06:49:04+00:00

I am writing a web application and have just implemented that a user can

  • 0

I am writing a web application and have just implemented that a user can sign in via Twitter, using spring-social-(core/twitter).

However, Twitter behaves strangely. After the initial authentication/authorization, every time I’m sending a user to Twitter for authentication, Twitter prompts to authorize my application again. I’ve looked into the connected Twitter profile. My app is there and authorized correctly (in my case for read access).

I don’t have a case of requesting additional permissions. All my application needs is read access (the authorization dialog confirms this).

I am using the OAuth1Operations (returned by the TwitterConnectionFactory) to do the OAuth dance and save the resulting connection in a database. My front-end is written with Wicket 1.5.

I can work around this behavior by just re-authorizing my app again and again when I want to sign in via Twitter, but this is a big nuisance. Anyone knows what I’m missing here?

Here is my code:

TwitterConnectionFactory connectionFactory = (TwitterConnectionFactory) connectionFactoryLocator.getConnectionFactory(Twitter.class);
String callbackUrl = [...];

if (pageParameters.get("oauth_token").isNull() || pageParameters.get("oauth_verifier").isNull()) {
    MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
    params.add("x_auth_access_type", "read");
    OAuthToken token = connectionFactory.getOAuthOperations().fetchRequestToken(callbackUrl, params);

    String url = connectionFactory.getOAuthOperations().buildAuthorizeUrl(token.getValue(), OAuth1Parameters.NONE);

    getSession().setAttribute("twitter_token", token);
    setResponsePage(new RedirectPage(url));
} else {
    String token = pageParameters.get("oauth_token").toString();
    String verifier = pageParameters.get("oauth_verifier").toString();

    OAuthToken previousToken = (OAuthToken) getSession().getAttribute("twitter_token");

    if (previousToken.getValue().equals(token)) {
        AuthorizedRequestToken authorizedRequestToken = new AuthorizedRequestToken(previousToken, verifier);

        OAuthToken accessToken = connectionFactory.getOAuthOperations().exchangeForAccessToken(authorizedRequestToken, null);
        Connection<Twitter> connection = connectionFactory.createConnection(accessToken);
    }
}
  • 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-05T06:49:05+00:00Added an answer on June 5, 2026 at 6:49 am

    I’ve found the solution! It is also detailed here: Simple Twitter Oauth authorization asking for credentials every time

    The problem was that I specifically requested Twitter to authorize my app every time. Replacing:

    String url = connectionFactory.getOAuthOperations().buildAuthorizeUrl(token.getValue(), OAuth1Parameters.NONE);
    

    with

    String url = connectionFactory.getOAuthOperations().buildAuthenticateUrl(token.getValue(), OAuth1Parameters.NONE);
    

    solves the issue!
    Calling the URL for authentication does only ask for authorization if the app hasn’t been authorized yet.

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

Sidebar

Related Questions

I have just started writing a web application. I am using GIT for version
I am using spring mvc 3.0 to build an web application. User can get
I'm currently writing a web application that have about 6-12 pages. On each one
I'm writing a web based application that will have its own authorization/authentication mechanism (traditional
I am writing a web application on Asp.Net MVC 3. Assume that we have
I'm writing a web application that will have plugins. The plugins will be .DLL
I have a web application that I'm writing (C#, MSSQL) and I need to
I'm writing a web application in Java where at some point user can enter
I have an asp.net c# web application where a user can log in and
I'm writing a web application (PHP) for my friend and have decided to use

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.