Authenticate users from PostgreSQL using SQLUserFolder

by Chris Miles last modified Apr 09, 2009 01:54 PM
How to use SQLUserFolder to authenticate Plone users from a remote PostgreSQL database.

Step 1:

  • install Zope and Plone
  • touch GroupUserFolder/preview.txt
  • restart Zope
  • add a Plone site
    • it is created with an: acl_users (Group-aware User Folder)
    • Users/Groups now work as usual; using default UserFolders with acl_users

Step 2:

Step 3:

  • [Setup PostgreSQL if not already!]
  createuser -U postgres zopeauth
  createdb -U postgres zopeauth
  psql -U postgres zopeauth -f SQLUserFolder/schema/postgresql

Step 4:

  • restart Zope

Step 5:

  • In Plone root, add a Z Psycopg Database Connection:
  id=  "auth_db"
  Connection String= "dbname=zopeauth user=zopeauth"
  • in Plone Setup Add/Remove: Install SQLUserFolder [This will install the ZSQL methods into portal_skins/SQLUserFolder/]
  • acl_users / Sources: "User source #1" Replace with SQLUserFolder - leave defaults
  • acl_users / Sources: "Groups source" - Replace with SQLUserFolder - change as per below
    • Name of user accounts (or groups) relation (table) = "zope_suf.groups"
    • Name of relation (table) holding login (or group) to role maps = "zope_suf.grouproles"

.. I think that is it. Access front-end and try to Join and then Login