Guest User

Atul's code Oauth views

a guest
Nov 22nd, 2011
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. def login(request):
  2.     key = "some key"
  3.     secret = "app secret key"
  4.     return_url = "http://localhost:8000/token/"
  5.     api     = linkedin.LinkedIn(key, secret, return_url)
  6.     if(api.request_token()):
  7.         auth_url     = api.get_authorize_url()
  8.         request.session['api_obj'] = api
  9.     return HttpResponseRedirect(auth_url)
  10.  
  11. #below is the view that will get called with the oauth oken.
  12. def token(request, param):
  13.     #This return api as "none". Anything wrong?
  14.     api     = request.session.get('api_obj')    
  15.     #do stuff with the api.
  16.  
Advertisement
Add Comment
Please, Sign In to add comment