File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes password encoding problem in it mandatory? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "password encoding problem in it mandatory?" Watch "password encoding problem in it mandatory?" New topic

password encoding problem in it mandatory?

dee sri

Joined: Mar 10, 2006
Posts: 5
I am trying to configure acegi security on top of a web- application in which the passwords are already entered manually in the MYSQL db.
Without using any passwordencoding also, the authentication fails , though correct password is entered.
also, is the enabled column mandatory in the authoritiesByUsernameQuery.

pl. see the following. i have commented teh passwordencoder and in the usersByUsernameQuery I have given enabled as true as there is no column called enabled in the db.Is this the right way to configure!

Pl. let me know why authentication is failing always!
also how to set up logging in case of acegi errors in tomcat?

part of applicationcontext-acegisecurity.xml
<!-- bean id="passwordEncoder" class="net.sf.acegisecurity.providers.encoding.Pla intextPasswordEncoder"/ -->

<bean id="daoAuthenticationProvider" class="net.sf.acegisecurity.providers.dao.DaoAuthe nticationProvider">
<property name="authenticationDao"><ref local="jdbcAuthenticationDao"/></property>
<!-- property name="userCache"><ref local="userCache"/></property -->
<!-- property name="passwordEncoder"><ref local="passwordEncoder"/></property -->

<bean id="jdbcAuthenticationDao" class="net.sf.acegisecurity.providers.dao.jdbc.Jdb cDaoImpl">
<property name="dataSource"><ref bean="dataSource"/></property>
<property name="usersByUsernameQuery">
<value>SELECT ACCOUNTID,PASSWORD,enabled as 1 FROM account WHERE ACCOUNTID = ?</value>
<property name="authoritiesByUsernameQuery">
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
I do not know the answer to your question but I rather suspect you will find the answer here
I agree. Here's the link:
subject: password encoding problem in it mandatory?
It's not a secret anymore!