I am new to Spring and Spring Security. I just need a pointer in the right direction:
I have a simple Spring MVC/Spring Security webapp. I want to add login functionality into web app. I have created following two table.
CREATE TABLE "users" (
"USER_ID" NUMBER(10) NOT NULL,
"USERNAME" VARCHAR(45) NOT NULL,
"PASSWORD" VARCHAR(45) NOT NULL,
"ENABLED" NUMBER(1) NOT NULL,
PRIMARY KEY ("USER_ID")
)
CREATE TABLE "user_roles" (
"USER_ROLE_ID" NUMBER(10) NOT NULL,
"USER_ID" NUMBER(10) NOT NULL,
"AUTHORITY" VARCHAR(45) NOT NULL,
PRIMARY KEY ("USER_ROLE_ID"),
CONSTRAINT "FK_user_roles" FOREIGN KEY ("USER_ID") REFERENCES "users" ("USER_ID")
)
I want to authenticate user from database then it checks role of the user. I know this is dirt simple, so I just need to hear how the process should flow.