This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

password encoding problem in acegi..is it mandatory?

 
dee sri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>

<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>
<property name="authoritiesByUsernameQuery">
<value>SELECT ROLEID,ROLEDESC FROM ROLE WHERE ROLEID = ?</value>
</property>
</bean>
 
Maximilian Xavier Stocker
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not know the answer to your question but I rather suspect you will find the answer here http://acegisecurity.org/docbook/acegi.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic