5

I'm trying to retrieve a user with the following code found in the gdata provisioning api documentation. I'm attempting this for a django 1.3 app, running gdata-2.0.16 in python2.7:

from gdata.apps import client
from myapp import settings
client = client.AppsClient(domain=settings.GOOGLE_ADMIN_DOMAIN)
client.ClientLogin(email=settings.GOOGLE_ADMIN_EMAIL, password=settings.GOOGLE_ADMIN_PASSWORD, source='apps')
user_account = client.RetrieveUser('user_name')

For privacy, I changed the actual username to 'user_name', but that's the general gist of the code.

When the interpreter gets to the last line in the code above, I get the following error:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/gdata/apps/client.py", line 182, in RetrieveNickname
    return self.GetEntry(uri, desired_class=gdata.apps.data.NicknameEntry)
  File "/usr/local/lib/python2.7/dist-packages/gdata/client.py", line 652, in get_entry
    desired_class=desired_class, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gdata/client.py", line 319, in request
    RequestError)
RequestError: Server responded with: 403, <HTML>
<HEAD>
<TITLE>Insecure HTTP requests not permitted.  Use HTTPS.</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Insecure HTTP requests not permitted.  Use HTTPS.</H1>
<H2>Error 403</H2>
</BODY>
</HTML>

I can't find anything in the documentation on using HTTPS instead of HTTP. What am I missing?

Nathan Jones
  • 4,063
  • 5
  • 39
  • 66

3 Answers3

8

After creating the client object, execute client.ssl = True. This will cause the gdata api to use a secure connection.

Nathan Jones
  • 4,063
  • 5
  • 39
  • 66
0

adding the line after the client authentication helps client.ssl=True.

Venu Murthy
  • 1,604
  • 1
  • 13
  • 13
0

Try patch attached to Comment 3 of the issue AppsService in Marketplace - SSL issues

user723893
  • 105
  • 5