Hi all, I'm storing users in Mysql, and doing custom authentication on them. I want to know if Zope has access to the crypt function, or if there is something equivalent that is preferred. Thanks. Alec Munro
Alec Munro wrote:
Hi all, I'm storing users in Mysql, and doing custom authentication on them. I want to know if Zope has access to the crypt function, or if there is something equivalent that is preferred. Thanks.
Alec Munro
No, there isn't AFAIK, I use an external method for that purpose. But since you're using MYSQL, it has various built-in functions which might fit you purposes. See http://www.mysql.com/doc/en/Miscellaneous_functions.html HTH, oliver
On Mon, 2002-08-26 at 13:57, Alec Munro wrote:
Hi all, I'm storing users in Mysql, and doing custom authentication on them. I want to know if Zope has access to the crypt function, or if there is something equivalent that is preferred. Thanks.
I did some digging into this last night and discovered that Zope's password authentication function recognizes LDAP-style password encoding prefixes. For UNIX crypt password, use this in your SELECT: SELECT ..., CONCAT('{CRYPT}', passwd) AS password ... This is real easy to do with SimpleUserFolder (on zope.org). A couple Z SQL Methods and you are done. A couple other encodings are recognized (SHA, SHAA); see AccessControl/AuthEncoding.py for more details. I believe it is possible to add other encodings with your own products. n.b. I thought that LDAP's password encoding names were either lower-case or case-insensitive, but all the Zope encoding names are upper-case. -- Andy Dustman PGP: 0x930B8AB6 @ .net http://dustman.net/andy "Cogito, ergo sum." -- Rene Descartes "I yam what I yam and that's all what I yam." -- Popeye
I have a simple product that does RC2 encryption and allows you to set a key in the ZMI, + a page for testing stuff... I can email the source to whoever needs it. It might not be the best possible code but works quite well and quite fast for keys upto 1K in size. I havent tested more than that.. AM Andy Dustman wrote:
On Mon, 2002-08-26 at 13:57, Alec Munro wrote:
Hi all, I'm storing users in Mysql, and doing custom authentication on them. I want to know if Zope has access to the crypt function, or if there is something equivalent that is preferred. Thanks.
I did some digging into this last night and discovered that Zope's password authentication function recognizes LDAP-style password encoding prefixes. For UNIX crypt password, use this in your SELECT:
SELECT ..., CONCAT('{CRYPT}', passwd) AS password ...
This is real easy to do with SimpleUserFolder (on zope.org). A couple Z SQL Methods and you are done.
A couple other encodings are recognized (SHA, SHAA); see AccessControl/AuthEncoding.py for more details. I believe it is possible to add other encodings with your own products.
n.b. I thought that LDAP's password encoding names were either lower-case or case-insensitive, but all the Zope encoding names are upper-case.
-- ================================================================== Aseem Mohanty Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706 (R) 510 7696011 (M) 510 3014871 (O) 510 5279231 ================================================================== "I saw `cout' being shifted "Hello world" times to the left and stopped right there!!" -- Steve Gonedes ==================================================================
participants (4)
-
Alec Munro -
AM -
Andy Dustman -
Oliver Bleutgen