Get the following error when configured for LDAP authentication, and xwiki.cfg has the following entries -
CONFIG -------------------------------------- xwiki.authentication.ldap=1 xwiki.authentication.createuser=ldap xwiki.authentication.ldap.server=ctsinhydcfac.cts.com xwiki.authentication.ldap.check_level=1 xwiki.authentication.ldap.port=389 xwiki.authentication.ldap.base_DN=dc=cts,dc=com xwiki.authentication.ldap.bind_DN=cn=Praveen Venkata Koduganty,ou=HYDERABAD,ou=INDIA,ou=COGNIZANTUSERS,dc=CTS,dc=COM xwiki.authentication.ldap.bind_pass=blahblah xwiki.authentication.ldap.UID_attr=sAMAccountName #xwiki.authentication.ldap.fields_mapping=name=sAMAccountName,last_name= sn,first_name=givenName,fullname=displayName,email=mail,ldap_dn=distingu ishedName xwiki.authentication.ldap.fields_mapping=name=sAMAccountName,last_name=s n,first_name=givenName,fullname=displayName,email=mail LOG ---------------------------------------- 14:57:02,747 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP Password check for user 160229 14:57:02,778 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP Check level is 1 14:57:02,793 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP Connect successfull to host ctsinhydcfac.cts.com and port 389 14:57:02,793 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP Bind starting 14:57:02,903 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP Bind successfull 14:57:02,918 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP Bind returned with result true 14:57:02,918 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP searching user 14:57:02,965 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP searching found user 14:57:02,965 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP searching found DN: CN=Praveen Venkata Koduganty,OU=HYDERABAD,OU=INDIA,OU=Cognizantusers,DC=cts,DC=com 14:57:02,965 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attributes 14:57:02,981 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute objectCategory 14:57:02,981 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute company 14:57:02,981 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute lastLogoff 14:57:02,996 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute cn 14:57:02,996 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute title 14:57:02,996 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute primaryGroupID 14:57:02,996 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute displayName 14:57:02,996 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute accountExpires 14:57:02,996 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute department 14:57:02,996 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute sn 14:57:03,028 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute userPrincipalName 14:57:03,028 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute middleName 14:57:03,028 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute sAMAccountName 14:57:03,043 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute mail 14:57:03,043 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute givenName 14:57:03,043 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute name 14:57:03,043 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP adding user attribute mailNickname 14:57:03,043 [http-8080-Processor24] INFO LDAP.LDAPAuthServiceImpl - LDAP Password check for user 160229 successfull 14:57:03,043 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - LDAP check in finally block 14:57:03,059 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - User authenticated successfully 14:57:03,059 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - Finding user 160229 14:57:03,059 [http-8080-Processor24] DEBUG store.XWikiHibernateBaseStore - Trying to get session from pool 14:57:03,059 [http-8080-Processor24] DEBUG store.XWikiHibernateBaseStore - Taken session from pool SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQu eue[insertions=[] updates=[] deletions=[] collectionCreations=[] collectionRemovals=[] collectionUpdates=[]]) 14:57:03,075 [http-8080-Processor24] INFO store.DBCPConnectionProvider - active: 1 (max: 50) idle: 1(max: 5) 14:57:03,075 [http-8080-Processor24] DEBUG store.XWikiHibernateBaseStore - Trying to open transaction 14:57:03,075 [http-8080-Processor24] DEBUG store.XWikiHibernateBaseStore - Opened transaction [EMAIL PROTECTED] 14:57:03,075 [http-8080-Processor24] DEBUG store.XWikiHibernateBaseStore - Releasing hibernate session SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQu eue[insertions=[] updates=[] deletions=[] collectionCreations=[] collectionRemovals=[] collectionUpdates=[]]) 14:57:03,075 [http-8080-Processor24] DEBUG store.XWikiHibernateBaseStore - Releasing hibernate transaction [EMAIL PROTECTED] 14:57:03,090 [http-8080-Processor24] INFO store.DBCPConnectionProvider - active: 0 (max: 50) idle: 2(max: 5) 14:57:03,090 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - Ready to create user from LDAP 14:57:03,090 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - Ready to create user from LDAP with field name=sAMAccountName,last_name=sn,first_name=givenName,fullname=displayNa me,email=mail 14:57:03,090 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - Create user from LDAP looking at field name 14:57:03,090 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - Create user from LDAP looking at field last_name 14:57:03,090 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - Create user from LDAP setting field last_name 14:57:03,090 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - Create user from LDAP looking at field first_name 14:57:03,090 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - Create user from LDAP setting field first_name 14:57:03,090 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - Create user from LDAP looking at field fullname 14:57:03,090 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - Create user from LDAP setting field fullname 14:57:03,106 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - Create user from LDAP looking at field email 14:57:03,106 [http-8080-Processor24] DEBUG LDAP.LDAPAuthServiceImpl - Create user from LDAP setting field email 14:57:03,106 [http-8080-Processor24] DEBUG store.XWikiHibernateBaseStore - Trying to get session from pool 14:57:03,106 [http-8080-Processor24] DEBUG store.XWikiHibernateBaseStore - Taken session from pool SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQu eue[insertions=[] updates=[] deletions=[] collectionCreations=[] collectionRemovals=[] collectionUpdates=[]]) 14:57:03,106 [http-8080-Processor24] INFO store.DBCPConnectionProvider - active: 1 (max: 50) idle: 1(max: 5) 14:57:03,106 [http-8080-Processor24] DEBUG store.XWikiHibernateBaseStore - Trying to open transaction 14:57:03,106 [http-8080-Processor24] DEBUG store.XWikiHibernateBaseStore - Opened transaction [EMAIL PROTECTED] 14:57:03,121 [http-8080-Processor24] INFO def.DefaultLoadEventListener - Error performing load command org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.xpn.xwiki.doc.XWikiDocument#-588615692] at org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundExceptio n.java:27) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventLi stener.java:128) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoad EventListener.java:177) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEvent Listener.java:87) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:891) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:799) at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore .java:350) at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:16 0) at com.xpn.xwiki.XWiki.getDocument(XWiki.java:936) at com.xpn.xwiki.XWiki.getDocument(XWiki.java:970) at com.xpn.xwiki.user.impl.LDAP.LDAPAuthServiceImpl.CreateUserFromLDAP(LDAP AuthServiceImpl.java:176) at com.xpn.xwiki.user.impl.LDAP.LDAPAuthServiceImpl.authenticate(LDAPAuthSe rviceImpl.java:120) at com.xpn.xwiki.user.impl.xwiki.MyFormAuthenticator.authenticate(MyFormAut henticator.java:180) at com.xpn.xwiki.user.impl.xwiki.MyFormAuthenticator.processLogin(MyFormAut henticator.java:111) at com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl.checkAuth(XWikiAuthSe rviceImpl.java:178) at com.xpn.xwiki.XWiki.checkAuth(XWiki.java:2906) at com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl.checkAccess(XWikiRig htServiceImpl.java:118) at com.xpn.xwiki.XWiki.checkAccess(XWiki.java:2914) at com.xpn.xwiki.XWiki.prepareDocuments(XWiki.java:3763) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:134) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr ocessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Raffaello Pelagalli Sent: Friday, September 14, 2007 3:48 PM To: XWiki Users Subject: Re: [xwiki-users] LDAP - importing users <[EMAIL PROTECTED]> writes: > Hi Raff, > I have enabled LDAP authentication and it works fine. Now I would want > to add the LDAP user on first logon, don't want a bulk LDAP import. I am > groovy illiterate, so trying to modify what you have written, and > referring to java code...Also, where do I put the following script for > it to run? I am supposing you have to put it in the wiki main home page > itself.. > > Something like - > > <%if (request.get("go") == "1") > { > username = request.getUserPrincipal() > username = context.getContext().getWiki().convertUsername(username, > context.getContext()) > def created = "created" > udoc = xwiki.getDocument("XWiki." + username) > if (!udoc.isNew()) > { > udoc.delete() > created = "updated" > } > xwiki.createEmptyUser(username,null,context.getContext()) > print("*" + created + "*" + " ") > print (" [XWiki." + username + "]") > } > } > %> > #if(!$request.get("go") || $request.get("go") != "1") [Import and/or > Update Users>$doc.name?go=1] #end > > Thanks > Praveen > Hi, You should add something like that in your xwiki.cfg : xwiki.authentication.createuser=ldap So users will be created at they don't exist in the wiki. With this method, you will not need any script on the wiki. Best regards, -- Raffaello Pelagalli XPertNet - XWiki.com _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users