6

I have been able to login to Google spreadsheet with gdata python client.programmaticlogin function following the sample/spreadsheet in gdata downloaded pack.

Now I am not able to login to my enterprise gapps 'me@mycompany.com' do I have to pass any other arms? I tried with account type Hosted didn't work.

I tried creating oath2 key from gui, I have my client id and email id generated. Running the oauth sample in gdata asks for consumerkey and secret key. Can somebody advise on this please?

askewchan
  • 45,161
  • 17
  • 118
  • 134
karthik
  • 305
  • 3
  • 10

2 Answers2

7

ok I got it solved with the below

import gdata.gauth

Client_id='xxx';
Client_secret='yyy'
Scope='https://spreadsheets.google.com/feeds/'
User_agent='myself'

token = gdata.gauth.OAuth2Token(client_id=Client_id,client_secret=Client_secret,scope=Scope,user_agent=User_agent)
print token.generate_authorize_url(redirect_uri='urn:ietf:wg:oauth:2.0:oob')
code = raw_input('What is the verification code? ').strip()
token.get_access_token(code)
print "Refresh token\n"
print token.refresh_token
print "Access Token\n"
print token.access_token
Maciej Gol
  • 15,394
  • 4
  • 33
  • 51
karthik
  • 305
  • 3
  • 10
0

Take a look here for an example of how to use client login. Its part of a library I created in order to make working with Google Spreadsheet simple.

yoav.aviram
  • 1,802
  • 15
  • 19
  • import gdata.gauth Client_id='xxx'; Client_secret='yyy' Scope='https://spreadsheets.google.com/feeds/' User_agent='myself' token = gdata.gauth.OAuth2Token(client_id=Client_id,client_secret=Client_secret,scope=Scope,user_agent=User_agent) print token.generate_authorize_url(redirect_uri='urn:ietf:wg:oauth:2.0:oob') code = raw_input('What is the verification code? ').strip() token.get_access_token(code) print "Refresh token\n" print token.refresh_token print "Access Token\n" print token.access_token – karthik Mar 08 '13 at 10:23