Hiya;
While I don't have direct experience working with a Kerberos
authentication backing, writing a repoze.who authentication plugin is
pretty trivial.
The key components are the Challenger, Identifier and Metadata Provider.
The flow is, the Identifier tests for the user credentials (can look in
the HTTP environment, as well as cookies), and if the user is not logged
in, passes to the Challenger. The Challenger requests credentials (a 401
Not Authorized), as you'd expect.
Finally, if the user is logged in, the Metadata Provider runs, which
pulls the user object out of storage, if you like. This can be as simple
or complex as necessary.
My solution (as recommended on the irc.freenode.net #repoze channel) is
to use a simple redirecting challenger to an unprotected Pylons route
(handling the login), and the stock auth_tkt Identifier to handle cookie
lookups.
Authentication is handled via PostgreSQL, in our case - this is done so
we can use the PGSQL roles and role trees in our Pylons application.
Also, since the Challenger is expected to be a WSGI-compatible
application, you can do a fairly complex authentication scheme - or,
since you're already interested in using .htpasswd, a very simple
Identifier test for HTTP_AUTHORIZATION, and a simple Challenger which
returns 401 Not Authorized directly would work very well - especially as
http://modauthkerb.sourceforge.net/ indicates that you'll be able to
directly authenticate against Kerberos from Apache.
You can have a look at the simple repoze.who stuff we put together @
https://public.commandprompt.com/projects/verticallychallenged/repository
It's pretty simplistic, and needs some bugfixes, but gets across the
basic idea.
Hope that helps,
Regards,
--
Aurynn Shaw
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 ext 103
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
We are all in the gutter, but some of us are looking at the stars.
-- Oscar Wilde