what web2py version are you using ? I just used with auth.settings.allow_basic_login = True
curl -u t...@test.com:test "url" and it works without a hitch in 1.99.7 Il giorno venerdì 13 aprile 2012 14:52:31 UTC+2, selecta ha scritto: > > I enable basic auth with > auth.settings.allow_basic_login = True > I tried > wget --user=u...@bla.de --password=xxx http:// > 127.0.0.1:8000/pyMantis/tlc/records.json/Strain > curl --head -u u...@bla.de:xxx http:// > 127.0.0.1:8000/pyMantis/tlc/records.json/Strain > > and the python code > import urllib2 > import base64 > url = 'http://127.0.0.1:8000/pyMantis/tlc/records.json/Strain' > username, password = 'u...@bla.de:xxx'.split(':') > > request = urllib2.Request(url) > base64string = base64.encodestring('%s:%s' % (username, password)). > replace('\n', '') > request.add_header("Authorization", "Basic %s" % base64string) > fp = urllib2.urlopen(request) > ... > > But nothing seems to work? Am I missing something? >