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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:43:43+00:00 2026-05-23T11:43:43+00:00

I think i’ve implemented twitter oauth correctly, but everytime a user clicks to login

  • 0

I think i’ve implemented twitter oauth correctly, but everytime a user clicks to login via twitter on my site, he is redirected to https://twitter.com/oauth/authenticate?oauth_token=XYZ where he is prompted to authorize my application again.

My source code is based on:
http://www.9lessons.info/2011/02/login-with-facebook-and-twitter.html which itself seems based on https://github.com/abraham/twitteroauth/tree/master/twitteroauth

$twitteroauth = new TwitterOAuth(TWITTER_KEY, TWITTER_SECRET);
// Requesting authentication tokens, the parameter is the URL we will be redirected to
$request_token = $twitteroauth->getRequestToken($site_url.'getTwitterData.php');

// Saving them into the session

$_SESSION['oauth_token'] = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];

// If everything goes well..
if ($twitteroauth->http_code == 200) {
    // Let's generate the URL and redirect
    $url = $twitteroauth->getAuthorizeURL($request_token['oauth_token']);
    header('Location: ' . $url);
} else {
    // It's a bad idea to kill the script, but we've got to know when there's an error.
    die('The Twitter service is currently not responding. Please try again later.');
}
?>

In twitteroauth.php, I earlier had:

   function accessTokenURL()  { return 'https://api.twitter.com/oauth/access_token'; }
   function authenticateURL() { return 'https://twitter.com/oauth/authenticate'; }
   function authorizeURL()    { return 'https://twitter.com/oauth/authorize'; }
   function requestTokenURL() { return 'https://api.twitter.com/oauth/request_token'; }

but then tried:

   function accessTokenURL()  { return 'https://api.twitter.com/oauth/access_token'; }
   function authenticateURL() { return 'https://api.twitter.com/oauth/authenticate'; }
   function authorizeURL()    { return 'https://api.twitter.com/oauth/authorize'; }
   function requestTokenURL() { return 'https://api.twitter.com/oauth/request_token'; }

as well – but no luck.

  • 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-23T11:43:44+00:00Added an answer on May 23, 2026 at 11:43 am

    Answer: The application’s permission level as set on twitter.com did not match what we were doing.

    Message from Twitter:

    If you use the oauth/authenticate
    method without setting either the
    force_login or screen_name parameter,
    Twitter will redirect back to your
    site as long as the user is logged
    into Twitter and already has a valid
    OAuth access token for your
    application. If you have recently
    switched your application’s permission
    level (for example, from read/write to
    read/write/DM), this redirect won’t
    happen since a new permission is being
    requested. If this doesn’t help, you
    may also want to post about this in
    our developer talk group:
    http://groups.google.com/group/twitter-development-talk
    . Our API engineering team interacts
    with developers here on a regular
    basis.

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

Sidebar

Related Questions

Think google have a limitation for user , so users have to login to
I think I have a basic understanding of this, but am hoping that someone
I think everyone knows this site http://pinterest.com/ and I don't want to create site
I think this could be a very easy question for you. But I have
Think of a scenario any application is running, and the user selected some text
Think Google Chrome's Inspect Element. When a user mouses over a line in Developer
I think I have a very popular problem, but not found answer for it
I think I read all the Infragistics and StackOverflow posts about this error, but
I think I get most of Mecurial, but one thing that bothers me is,
Think twitter where you paste a link next to some plain text and when

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.