Hi All ,
I have duplicated the JdbcDaoImpl ,DaoAuthenticationProvider , AuthenticationDao so that my userByUsernameQuery takes two parameters to retrieve the uname/Pword .
Since i dont need to strict any user on basis of url after loging in i have made the following changes to this method ,
As this just a start i am not using any securityEnforcementFilterCode:public UserDetails loadUserByUsername(String company_sk ,List credentials) throws UsernameNotFoundException, DataAccessException { String paramss[] =new String[]{company_sk,(String)credentials.get(0)}; List users = usersByUsernameMapping.execute(paramss); if(users.size() == 0) throw new UsernameNotFoundException("User not found"); UserDetails user = (UserDetails)users.get(0); //List dbAuths = authoritiesByUsernameMapping.execute(user.getUsername()); // System.out.println("GrantedAuthority-->"+dbAuths); //if(dbAuths.size() == 0) // { // throw new UsernameNotFoundException("User has no GrantedAuthority"); // } else // { GrantedAuthority arrayAuths[] = new GrantedAuthority[]{new GrantedAuthorityImpl("ROLE_TELLER")}; // addCustomAuthorities(user.getUsername(), dbAuths); //arrayAuths = (GrantedAuthority[])(GrantedAuthority[])dbAuths.toArray(arrayAuths); return new User(user.getUsername(), user.getPassword(), user.isEnabled(), true, true, true, arrayAuths); // } }
So my filter chain proxy looks like this
the passwords are getting authenticated fine and even a successAuthentication token is created but Finally ,the Acegi throws a error like thisCode:<bean id="filterChainProxy" class="net.sf.acegisecurity.util.FilterChainProxy"> <property name="filterInvocationDefinitionSource"> <value> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT /**=httpSessionContextIntegrationFilter, authenticationProcessingFilter </value> </property> </bean>
Any Help??Code:org.springframework.jdbc.BadSqlGrammarException: executing PreparedStatementCallback; bad SQL grammar [SELECT USERNAME, PASSWORD from USERS]; nested exception is java.sql.SQLException: ORA-00942: table or view does not exist org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:223) org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:456) org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:491) org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:522) org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:543) org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:114) org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:124) org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:139) com.springapp.db.UserInfoDaoJdbc.getUserInfoList(UserInfoDaoJdbc.java:22) com.springapp.bean.UserInfoManager.getUserInfoList(UserInfoManager.java:18) com.springapp.controller.SpringappController.handleRequest(SpringappController.java:29) org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter
I also need to make sure if it is possible more than one parameter in the authorityByUserNameQuery ??
Thanx ,
Lingan![]()


