我想使用spring security对用户进行身份验证 . 我正在使用hiebrnate和jsf . 问题出在我在网上看到的不同教程中只有一个角色 . 但在我的情况下,我有一个具有权限和配置文件的不同数据库
表用户
用户ID
Profiles ID
登录
密码
表格简介
profile_id
Profiles
表操作或权限
action_id
行动
我想知道是否有人知道如何实现这一点或知道一些很好的教程 .
如果要管理用户角色,组和权限,可以看到Spring Security documentation about schema . 这里有一些片段和上述链接的详细信息:
create table users( username varchar_ignorecase(50) not null primary key, password varchar_ignorecase(50) not null, enabled boolean not null); create table authorities ( username varchar_ignorecase(50) not null, authority varchar_ignorecase(50) not null, constraint fk_authorities_users foreign key(username) references users(username)); create unique index ix_auth_username on authorities (username,authority); create table groups ( id bigint generated by default as identity(start with 0) primary key, group_name varchar_ignorecase(50) not null); create table group_authorities ( group_id bigint not null, authority varchar(50) not null, constraint fk_group_authorities_group foreign key(group_id) references groups(id)); create table group_members ( id bigint generated by default as identity(start with 0) primary key, username varchar(50) not null, group_id bigint not null, constraint fk_group_members_group foreign key(group_id) references groups(id));
1 回答
如果要管理用户角色,组和权限,可以看到Spring Security documentation about schema . 这里有一些片段和上述链接的详细信息: