Announcement Announcement Module
Collapse
No announcement yet.
Spring security integration with hibernate Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring security integration with hibernate

    Hi,
    I am using the current configuration:
    • spring security
    • hibernate
    • spring mvc

    I have set up the database using the recommended schema for the table user and authorities.



    I have define a hibernate session:

    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="namingStrategy">
    <ref bean="namingStrategy"/>
    </property>
    <property name="configLocation">
    <value>/WEB-INF/hibernate.cfg.xml</value>
    </property>
    </bean>

    In the security definition:

    <jdbc-user-service data-source-ref="sessionFactory"
    authorities-by-username-query="select username,authority from users where username=?"/>

    But using the sessionFactory does not work. Is there any way that I can use the sessionFactory in this manner?
    If not, what is the suggested way to reuse the hibernate objects that I have?

    Thanks in advance,
    DP
Working...
X