I am not able to make Spring Security work. I tested my application with security:user-service
and it works perfectly well. However when I replace the
<security:user-service>
<security:user name="XX" password="XX" authorities="ROLE_EDITOR" />
</security:user-service>
with
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider>
<security:jdbc-user-service data-source-ref="dataSource"
users-by-username-query="SELECT name as username, password, 1 as enabled FROM cuser WHERE name=?;"
authorities-by-username-query="SELECT u.name as username, r.name as authority FROM cuser u join cuserrole ur on ur.iduser=u.id join crole r on r.id=ur.idrole where u.name=?;" />
</security:authentication-provider>
</security:authentication-manager>
I can no longer make it work. Keep getting 403 response from the server. I ran the queries on my db and they return the expected values.
I am not able to make the logging work either, so am finding it hard to debug what is really happening behind the scenes. I did read similar problems on SO
How do I enable logging for Spring Security?
Debugging Spring configuration
Tried the solutions nut still the logging doesn't work. If someone has any idea, your help is appreciable.