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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:55:40+00:00 2026-05-27T03:55:40+00:00

I am building an app for making API calls to websites like (FB, LinkedIn,

  • 0

I am building an app for making API calls to websites like (FB, LinkedIn, etc.) I need to use OAuth to authorize my application to request data on behalf of the user. I am stuck with a problem of storing the instance of my website interface library (LinkedIn) across views. I used request.session – with file back end.

Below is the code http://pastebin.com/QTgqSr7W

Am I doing something wrong? can see the value being set in login() but I cannot see the same value in token(). Is this wrong to expect? Any workaround for passing the value of the api instance?

Thanks and Regards,
Atul.

  • 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-27T03:55:41+00:00Added an answer on May 27, 2026 at 3:55 am

    hmm, i think its because you are saving the entire api python instance, i dont think that sessions support that kind of data, why not just redirect user to auth url without saving something in session, then in callback view, you instantiate the linkedin.LinkedIn class like so

    from django.conf import settings
    
    key = settings.KEY
    secret = settings.SECRET
    return_url = settings.CALLBACK
    
    
    # You make the api connection here, so its not tied to any function
    api = linkedin.LinkedIn(key, secret, return_url)
    
    def login(request):
        if api.request_token():
            auth_url = api.get_authorize_url()
            return HttpResponseRedirect(auth_url)
    
    #below is the view that will get called with the oauth oken.
    def token(request, param):
        #do stuff with the api.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app is making heavy use of webservice calls. Lately, some of the calls
I'm building an API to power a site as well as making an app
I'm making use of JqueryMobile for building my android app. The problem I'm facing
I'm building an app that authors would (hopefully) use to help them, uh.. author
I'm building a app that need manage money datatype. I'm new on Obj-c, so
I am building a Twitter app (with oAuth) and I cannot find any info
I'm building a mobile app for Android and I need to pool HTTP requests
In an app I'm building, One of the features i'd like users to be
In a rails 2 app I'm building, I have a need to update a
We are building a Silverlight application and have calls to a Silverlight-WCF service. 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.