I am authenticating users in ldap, but this happens only once, when user is logging in. Afterwards I need to keep username and password, because before every ldap operation I need to make bind on ldap server before every operation. What is the safe way to cache this password (I can't store in the database or cookies) for as long as session persists.
+1
A:
solution 1: maybe the most elegant solution would be to write your own auth-backend and share it with the community :-)
solution 2: make use of the very good caching-api which django has build-in
renton
2010-03-08 16:26:31
I have written my own auth-backend for ldap, but inside database I store unusable password. Where should I store the real one, so it would work as long as session is active?
gruszczy
2010-03-08 16:28:47
why not dead simple in the session?
renton
2010-03-08 16:38:50
renton: Because it is not safe. You cannot encrypt it since you will need it for further ldap operations.
Uszy Wieloryba
2010-03-08 18:57:56
It the session is in the memory only it is pretty safe.
pajton
2010-03-08 19:10:15
+2
A:
You may cache authentication credentials in sessions. If you are afraid that they may "leak" to disk, i.e. be cached in database, you may use memory based sessions.
With cache session engine (Using cached sessions) and memory based sessions this should be accomplished easily.
pajton
2010-03-08 16:42:08