Using spring-security: WebSecurityConfigurerAdapter:
auth.jdbcAuthentication().usersByUsernameQuery: what should the query
string look like...
Using postgresql db with two tables to authenticate login ...(users and
authorities)
CREATE TABLE users (
username character(50) NOT NULL,
password character(50) NOT NULL,
enabled boolean NOT NULL,
CONSTRAINT users_pkey PRIMARY KEY (username)
)
CREATE TABLE authorities (
username character(50) NOT NULL,
authority character(50) NOT NULL,
CONSTRAINT fk_authorities_users FOREIGN KEY (username)
REFERENCES users (username) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
What am I doing wrong when I try to do the following?
registerAuthentication(AuthenticationManagerBuilder auth){
auth.
jdbcAuthentication()
.usersByUsernameQuery("select users.username, users.password,
authorities.authority from users join authorities on
users.username=authorities.username where users.username");
}
Thanks
No comments:
Post a Comment