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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:53:43+00:00 2026-06-14T09:53:43+00:00

I’m trying to get a website to connect to LinkedIn, I know I have

  • 0

I’m trying to get a website to connect to LinkedIn, I know I have to use OAuth tokens to connect to it, and I have seen the examples on the LinkedIn developer site, however, they all use the OAuth2 library and the site that I’m working with uses the rauth library, which seems to skip a few of the steps. It already has Twitter integrated, so I’ll include the code below in case anyone doesn’t quite understand what I mean.

twitter.py:

import json

from django.http import HttpResponse
from django.conf import settings
from rauth.service import OAuth1Service

def twitter(request, username):
    twitter = OAuth1Service(
    name='twitter',
    consumer_key=settings.TWITTER_CONSUMER_KEY,
    consumer_secret=settings.TWITTER_CONSUMER_SECRET,
    request_token_url=settings.TWITTER_API_URL + 'oauth/request_token',
    access_token_url=settings.TWITTER_API_URL + 'oauth/access_token',
    authorize_url=settings.TWITTER_API_URL + 'oauth/authorize',
    header_auth=True)

url = '{0}1/statuses/user_timeline.json?include_rts=false' \
    '&exclude_replies=true&count=50&screen_name={1}'.format(
        settings.TWITTER_API_URL, username)

r = twitter.request('GET', url, access_token=settings.TWITTER_USER_KEY,
                    access_token_secret=settings.TWITTER_USER_SECRET)

return HttpResponse(content=json.dumps(r.response.json),
                    status=r.response.status_code,
                    content_type=r.response.headers['content-type'])

Since it isn’t commented, I think it’s makes a request to the url which returns the user’s timeline when sent, but how come there’s no request token creation OR access token creation? It has the TWITTER_USER_KEY and TWITTER_USER_SECRET, but the rauth documentation says you should call explicit methods to get the tokens. What am I missing here?

EDIT: I’d quite like to just use the rauth library, and not meddle around with other libraries too.

  • 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-14T09:53:44+00:00Added an answer on June 14, 2026 at 9:53 am
    r = twitter.request('GET', url, access_token=settings.TWITTER_USER_KEY,
                    access_token_secret=settings.TWITTER_USER_SECRET)
    

    The function twitter creates an OAuth1Service and returns the object. The above code requests the users timeline and it seems that the access tokens and secrets are present in the settings object. It could be that the authentication routine for obtaining the access token and secrets is elsewhere.

    A typical example of the usage of the library (taken directly from the rauth documentation http://packages.python.org/rauth/)

    service = OAuth1Service(
               name='example',
               consumer_key='123',
               consumer_secret='456',
               request_token_url='http://example.com/request_token',
               access_token_url='http://example.com/access_token',
               authorize_url='http://example.com/authorize')
    
    request_token, request_token_secret = service.get_request_token()
    authorize_url = service.get_authorize_url(request_token)
    

    The authorize URL is passed to the browser so that it will redirect the user to the oAuth provider’s website and he can grant permission for the application and thereafter redirected to the client and the below request can be sent to obtain the access token using which requests to fetch data can be made.

    response = service.get_access_token(method='GET'
                                 request_token=request_token,
                                 request_token_secret=request_token_secret)
    request_token, request_token_secret = service.get_request_token()
    

    Happy coding 🙂

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

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I am trying to understand how to use SyndicationItem to display feed which is
I have a French site that I want to parse, but am running into
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.