Richard Clark wrote: > A better bet would be to simply enable json where appropriate, and make > sure identity accepts HTTP AUTH (it does by default), you should then > be able to access any of the URLs with the username and password > specified as http auth, and avoid the need for cookies (it works, I do > it :) > > Best of both worlds, no new interface to code, nice straightforward > requests.
This sounds like a great (great!) idea. Seriously. Here is what I'm trying: >>> import urllib2 >>> url = "http://localhost:8080" >>> username = "samuraisam" >>> password = "bar" >>> pm = urllib2.HTTPPasswordMgrWithDefaultRealm() >>> pm.add_password(None, url, username, password) >>> ah = urllib2.HTTPBasicAuthHandler(pm) >>> opener = urllib2.build_opener(ah) >>> urllib2.install_opener(opener) >>> d=urllib2.urlopen('http://localhost:8080/project') But, (but!), I keep getting a 403 error, as in urllib2.HTTPError: HTTP Error 403: Forbidden. The exact same usage of urllib2 for my router on http://192.168.1.1 worked perfectly. So it (imo) has to be a TG problem. I have explicitly enabled http_auth in the configuration file. Though, even after explicitly dissalowing both the form and visit forms of authentication for identity, those both still work. So... what could be going wrong here? Thanks, Sam --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---

