jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anand Bhagwat" <abbhagwa...@gmail.com>
Subject Question regarding Custom Authentication and Authorization with springmodules
Date Wed, 02 Apr 2008 10:13:31 GMT
I intend to use jackrabbit with custom authentication and authorization. So
each user which logs in to application would have different access rights on
repository and typically he would be having a separate session. I am also
planning to use springmodules for JCR and I saw some samples for it. Below
is one such sample.
But the problem in this approach is that JcrSessionFactory is been
initialized with a fix set of credentials. So my question is there any way
that I can use custom authentication and authorization and still use
springmodules to get benefits offered by springmodules like declarative
transactions, JcrTemplate etc.

Spring Context -->

    <bean id="repository"
      <!-- normal factory beans params -->
      <property name="configuration" value="classpath:jackrabbit-repo.xml"/>
      <property name="homeDir" value="/repo"/>

    <bean id="sessionFactory"
      <property name="repository" ref="repository"/>
      <property name="credentials">
       <bean class="javax.jcr.SimpleCredentials">
        <constructor-arg index="0" value="bogus"/>
        <!-- create the credentials using a bean factory -->
        <constructor-arg index="1">
         <bean factory-bean="password"

    <!-- create the password to return it as a char[] -->
    <bean id="password" class="java.lang.String">
      <constructor-arg index="0" value="pass"/>

    <bean id="jcrTemplate" class="org.springmodules.jcr.JcrTemplate">
      <property name="sessionFactory" ref="sessionFactory"/>
      <property name="allowCreate" value="true"/>


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message