All,
I have need of creating a small python script which would obtain the
current build page (bitten) and return a dictionary of status (and I would
be happy to relinquish this small code on demand). In order for this to
work, I need to authenticate to any Trac resource beyond the main page. I
have yet to successfully do so. Using the examples on the following site:
http://docs.python.org/howto/urllib2.html works fine when retrieving
resources from an LDAP protected location. But not to a Trac resource.
My Trac/Apache configuration (urllib2 fails):
########################
# WSGI trac_test Trac page here:
WSGIScriptAlias /trac_test /data/trac/trac_test/htdocs/trac_init.wsgi
<Directory /data/trac/trac_test/htdocs>
Options -Indexes
WSGIApplicationGroup %{GLOBAL}
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
<Location '/trac_test/login'>
AuthType Basic
AuthName "Trac Test Site"
AuthBasicProvider ldap
AuthLDAPURL "ldap://<someserver>/dc=sub,dc=com?uid"
AuthzLDAPAuthoritative off
require valid-user
Allow from all
</Location>
########################
An Apache resource configuration (urllib2 succeeds):
########################
<Directory /srv/www/ssl/somelocation>
AuthType Basic
AuthGroupFile /data/authz_generator/apache_groups
AuthName "Doxygen Access"
AuthBasicProvider ldap
AuthLDAPURL "ldap://<someserver>/dc=sub,dc=com?uid"
AuthzLDAPAuthoritative off
require group <somegroup>
Allow from all
</Directory>
########################
When I attempt to connect to /trac_test/login (or any Trac resource) I
receive:
urllib2.HTTPError: HTTP Error 401: Authorization Required
I realize I may have to fiddle with cookielib (maybe not). And that will be
an issue for another time.
Is there an urllib2.Request.add_header() method I should be calling
specifically for wsgi Trac resources? When I look at the error logs, the
authentication error headers look identical... so I am not sure what I
should be asking for. I have yet to peak into the way bitten_slave
authenticates... And I suppose I may have to, unless someone here has a
quick "Yeah... you just add_header("blah we's need special trac wsgi
access: %s" % hash)" :)
Thanks in advance!
Jason Miller
--
You received this message because you are subscribed to the Google Groups "Trac
Users" 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/trac-users?hl=en.