May 2015
Intermediate to advanced
234 pages
4h 18m
English
In this recipe, you'll learn how to use user credentials (username and password) from a database for authentication.
Here are the steps to use user credentials in a database for authentication:
pom.xml:<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency> users and authorities tables:create table users( username varchar(50) not null, password varchar(50) not null, enabled boolean not null default true, primary key (username) ); create table authorities ( username varchar(50) not null, authority varchar(50) not null, constraint fk_authorities_users ...
Read now
Unlock full access