Im using python (django framework) to gain a request token from google api, but the request token always comes back empty

StackOverflow https://stackoverflow.com/questions/8936711

Question

Here is sample code that I'm working with.

def index(request):                     
flow = OAuth2WebServerFlow(
        client_id='xyz.apps.googleusercontent.com',
        client_secret='xyz',
        scope='https://www.googleapis.com/auth/plus.me',
        user_agent='sample/1.0')

callback = 'http://%s/oauth2callback' % request.META[ 'HTTP_HOST' ]
authorize_url = flow.step1_get_authorize_url(callback)

return HttpResponse(flow)

For some reason 'flow' is always set to " " or empty instead of a request token. I have searched for days on this issue. Can anyone tell me why I can't get a request token from google using this method?

fyi: I know that I should be redirecting the user to the authorize url, but I want to see if flow is set before I do since Google will provide the authorize url even if a request token wasn't returned.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top