I decided to modify my application by adding there authentication using spring security
and database. Before I was using plain authentication with user
and password
in XML. It worked fine.
My authentication-manager
looks like this
<authentication-manager>
<authentication-provider>
<jdbc-user-service data-source-ref="dataSource"
users-by-username-query="select username, password from pmc.username_password where username=?;"
authorities-by-username-query="select a.username, b.role from pmc.username_password a, pmc.username_role b where a.username = b.username and a.username=?;" />
</authentication-provider>
</authentication-manager>
But when I make an attempt to authenticate I've got exception
org.springframework.security.authentication.InternalAuthenticationServiceException: PreparedStatementCallback; SQL [select u
sername, password from pmc.username_password where username=?;]; The column index is out of range: 3, number of columns: 2.;
nested exception is org.postgresql.util.PSQLException: The column index is out of range: 3, number of columns: 2.
What is wrong in my sql
syntax in XML file?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…