I have tried to use the jdbc-user-service out of box but with some customization. It seems that defining the authorities-by-username-query doesn't work at all.
authorities-by-username-query="select EMAIL as username, PASSWORD as password, 'true' as enabled from USER where EMAIL=?"
It's still trying to execute the predefined SQL query.
22:40:37,300 DEBUG SQLErrorCodeSQLExceptionTranslator:399 - Translating SQLException with SQL state '42S22', error code '1054', message [Unknown column 'username' in 'field list']; SQL was [select username,password,enabled from users where username = ?] for task [PreparedStatementCallback]
Does anyone know how to fix this issue?