You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Ke...@sybase.com on 2005/06/07 19:32:33 UTC

ldap and file access question

I hope someone has done what I am trying to do and can give me some insight
and direction.  Thanks in advance.

I am using Slide 2.2, JBoss 401 and openldap.  The webapp user logins in
using the jbossloginmodule and the username/password gets checked against
openldap (normal webapp login).  The user is now logged in the webapp.
When the user uploads a file I get a WebDAVConnection but the
username/password is hardcoded to something I setup in Slide.  I am now
replacing slide auth with ldap auth.  Since the webapp and slide can both
use ldap I would like to make this work.  Any suggestions on how I can get
the username/password from my webapp/ldap and pass it in as the parameter
for the WebDAVConnection call?  It is more of a webapp/ldap question but
figure if someone has already done this setup they would be able to help
me.  We are using JBoss/openLDAP as outlined in this developer.com article
with code.  http://www.developer.com/java/ejb/article.php/3077421

I have seen the example (JNDI-Domain.xml) and setup my domain.xml to use
JNDIPrincipalStore for users and roles.  When my webapp loads slide.war it
connects using the parameters I have specified (I fixed the exceptions and
warnings when it was trying to connect).

Next question:
The webapp dynamically creates the directory structure.  In domain.xml I am
setting the top level directory "/files" to have read/write for all roles.
I want to be more specific for directories below the top level.  I want
everyone to be able to read but only certain users/roles to be able to
write/edit, can I do this dynamically and how?

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


auto-create-users

Posted by Ke...@sybase.com.
Could someone give me more information on when to use auto-create-users and
the .xml syntax.  I am guessing you use it when you use LDAP or JAAS
(nonSlide) authentication?
Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: ldap and file access question

Posted by Ke...@sybase.com.
I am doing this one step at a time.  The first step I was to change the
domain.xml to use JNDIPrincipalStore for users and roles (when the war file
loads it looks like it connects fine to openldap).    I deleted the
users.def.xml and roles-def.xml to make sure they got regenerated (or not
generated at all since it is not being used).  In my code I hardcoded the
username and password (for testing of the JNDIPrincipalStore connection)
and I get the following error.

I have tried a username/password combo that I use in my webapp to openldap
for security that works but fails with slide, and I have tried the
principal/credentials used in the domain.xml (also used and works in
JExplorer) but it fails with slide.  What should I be using in the
WebDAVConnection for a username/password and format that gets passed to
JNDIPrincipalStore to make it work?

10:47:03,779 INFO  [STDOUT] Getting connection with spec
org.apache.webdav.connector.WebDAVConnectionSpec@1ca2f7c
10:47:03,839 INFO  [STDOUT] Opening: http://localhost:16080/slide/files
10:47:05,010 INFO  [HttpMethodBase] Already tried to authenticate with
'Slide DAV Server' authentication realm at localhost, but still receiving:
HTTP/1.1 401 Unauthorized
10:47:05,010 INFO  [WebDAV-Connector] Exception:
org.apache.commons.httpclient.HttpException
10:47:05,010 INFO  [WebDAV-Connector]
org.apache.commons.httpclient.HttpException

Here is my doamin.xml:

<!-- Use a JNDIPrincipalStore to for users -->
<store name="users">
      <nodestore
classname="org.apache.slide.store.txjndi.JNDIPrincipalStore">
            <!-- See javadoc for JNDIPrincipalStore for description of
parameters -->
            <parameter name="cache.refresh.checkrate">15</parameter>
            <parameter name="cache.refresh.rate">600</parameter>
            <parameter name="cache.refresh.threshold">500</parameter>
            <parameter name="jndi.container">ou=People, dc= oni,
dc=mil</parameter>
            <parameter name="jndi.attributes.rdn">cn</parameter>
            <parameter
name="jndi.search.filter">(objectClass=inetOrgPerson)</parameter>
            <parameter name="jndi.search.scope">ONELEVEL_SCOPE</parameter>
            <parameter
name="jndi.search.attributes">postalCode,initials,givenName,uid,mail,fullName,telephoneNumber,title,facsimileTelephoneNumber,groupMembership,l,sn,cn</parameter>
            <parameter
name="java.naming.provider.url">ldap://localhost:389</parameter>
            <parameter
name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</parameter>
            <parameter
name="java.naming.security.principal">cn=root,dc=oni,dc=mil</parameter>
            <parameter
name="java.naming.security.authentication">simple</parameter>
            <parameter
name="java.naming.security.credentials">root</parameter>
      </nodestore>
      <securitystore>
            <reference store="nodestore"/>
      </securitystore>
      <lockstore>
            <reference store="nodestore"/>
      </lockstore>
      <revisiondescriptorsstore>
            <reference store="nodestore"/>
      </revisiondescriptorsstore>
      <revisiondescriptorstore>
            <reference store="nodestore"/>
      </revisiondescriptorstore>
      <contentstore>
            <reference store="nodestore"/>
      </contentstore>
</store>

<!-- Use a JNDIPrincipalStore for roles -->
<store name="roles">
      <nodestore
classname="org.apache.slide.store.txjndi.JNDIPrincipalStore">
            <!-- See javadoc for JNDIPrincipalStore for description of
parameters -->
            <parameter name="cache.refresh.checkrate">15</parameter>
            <parameter name="cache.refresh.rate">600</parameter>
            <parameter name="cache.refresh.threshold">500</parameter>
            <parameter name="jndi.container">ou=Roles, dc= oni,
dc=mil</parameter>
            <parameter name="jndi.attributes.rdn">cn</parameter>
            <parameter
name="jndi.attributes.groupmemberset">uniqueMember</parameter>
            <parameter
name="jndi.search.filter">objectClass=groupOfUniqueNames</parameter>
            <parameter name="jndi.search.scope">ONELEVEL_SCOPE</parameter>
            <parameter name="jndi.search.attributes">cn</parameter>
            <parameter
name="java.naming.provider.url">ldap://localhost:389</parameter>
            <parameter
name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</parameter>
            <parameter
name="java.naming.security.principal">cn=root,dc=oni,dc=mil</parameter>
            <parameter
name="java.naming.security.authentication">simple</parameter>
            <parameter
name="java.naming.security.credentials">root</parameter>
      </nodestore>
      <securitystore>
            <reference store="nodestore"/>
      </securitystore>
      <lockstore>
            <reference store="nodestore"/>
      </lockstore>
      <revisiondescriptorsstore>
            <reference store="nodestore"/>
      </revisiondescriptorsstore>
      <revisiondescriptorstore>
            <reference store="nodestore"/>
      </revisiondescriptorstore>
      <contentstore>
            <reference store="nodestore"/>
      </contentstore>
</store>




                                                                           
             Kevin.Bombardier@                                             
             sybase.com                                                    
                                                                        To 
             06/07/2005 01:32          "Slide Users Mailing List"          
             PM                        <sl...@jakarta.apache.org>     
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
               "Slide Users            ldap and file access question       
               Mailing List"                                               
             <slide-user@jakar                                             
              ta.apache.org>                                               
                                                                           
                                                                           
                                                                           




I hope someone has done what I am trying to do and can give me some insight
and direction.  Thanks in advance.

I am using Slide 2.2, JBoss 401 and openldap.  The webapp user logins in
using the jbossloginmodule and the username/password gets checked against
openldap (normal webapp login).  The user is now logged in the webapp.
When the user uploads a file I get a WebDAVConnection but the
username/password is hardcoded to something I setup in Slide.  I am now
replacing slide auth with ldap auth.  Since the webapp and slide can both
use ldap I would like to make this work.  Any suggestions on how I can get
the username/password from my webapp/ldap and pass it in as the parameter
for the WebDAVConnection call?  It is more of a webapp/ldap question but
figure if someone has already done this setup they would be able to help
me.  We are using JBoss/openLDAP as outlined in this developer.com article
with code.  http://www.developer.com/java/ejb/article.php/3077421

I have seen the example (JNDI-Domain.xml) and setup my domain.xml to use
JNDIPrincipalStore for users and roles.  When my webapp loads slide.war it
connects using the parameters I have specified (I fixed the exceptions and
warnings when it was trying to connect).

Next question:
The webapp dynamically creates the directory structure.  In domain.xml I am
setting the top level directory "/files" to have read/write for all roles.
I want to be more specific for directories below the top level.  I want
everyone to be able to read but only certain users/roles to be able to
write/edit, can I do this dynamically and how?

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org