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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:25:09+00:00 2026-05-18T01:25:09+00:00

My app requires from users to login with their twitter acount! I am using

  • 0

My app requires from users to login with their twitter acount! I am using tardate oauth lib (from Paul Gallagher). That works fine. I wanna create an API for my website (actually the user authentication part). Twitter Basic Auth has been deprecated and now twitter uses twitter echo. If a user wants to upload a file via api in my app, he must include in his request the above header. So, my problem is: (i suppose that header hits twitter api directly and twitter returns in my url the response..is this right?)

how my app can handle the twitter response? json that contains user’s info (or a negative response 401), in order to continue the uploading or not. Something like the twitpic API does.(http://dev.twitpic.com/docs/2/upload/) or by similar services.

curl -v -H 'X-Auth-Service-Provider: https://api.twitter.com/1/account/verify_credentials.json' -H 'X-Verify-Credentials-Authorization: OAuth realm="http://api.twitter.com/",
oauth_consumer_key="yTrEIQH6jhtmLUypg8T5", oauth_signature_method="HMAC-SHA1",  
oauth_token="514797-YuI8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWTyu",oauth_timestamp="1271323750",
oauth_nonce="oYu6nMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7U9Y", 
oauth_version="1.0", oauth_signature="CV4bTfE7Rs9J1kafTGwufLJdspo%3D"' -F "file=@/path/to/file" http://localhost:3000/api/upload.xml

my def upload currently works for a simple upload via api. Without a user info. But in this way my app doesn’t know the file owner!

def upload
        file = File.new
        file.file = params[:file]
        # ... extra code
        respond_to do |format|
            if file.save                
                format.xml  { render :xml => file, :status => :created, :location => file }
            else
                format.xml  { render :xml => file.errors, :status => :unprocessable_entity }    
            end
        end
     end

Do you have any idea how can be the coding logic?

Any help will be highly appreciated 🙂

  • 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-18T01:25:09+00:00Added an answer on May 18, 2026 at 1:25 am

    I think that the best way is to grab headers and then use Patron..

    auth_headers = request.headers["X-Verify-Credentials-Authorization"]
    

    Patron can make a post request to https://api.twitter.com/1/account/verify_credentials.json and then check the resp status!

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

Sidebar

Related Questions

Is there an app or way to browse a directory that requires different login
I'm working on an app that requires no user input, but I don't want
Maybe theres another solution to this. I built a web app that requires 5-10
My app pulls info from my users' Google Calendars. The users already have to
I am developing a web app which requires a username and password to be
I have a cocoa app with two types windows each of which requires a
My app uses a WebRequest at certain points to get pages from itself. This
I am working on a web application which requires the user to login before
We have an MSI installer for a .Net WinForms app for Windows XP that
I am working on a web app project that has been in development for

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.