Security certification with TOCMAT security domain

xiaoxiao2021-03-06  61

Note: Transfer from http://blog.9cbs.net/ezerg/archive/2004/09/30/121481.aspx security domain function is Tomcat built-in function, declare a group of users in the org.apache.catalina.realm interface Methods of name, password, and associated roles are integrated into TOCMAT.

Memory Domain: MemoryRealm reads secure authentication information from the XML file and stores in memory. JDBC Domain: JDBCREALM Access information stored in the database via JDBC drivers. Data Source Domain: DataSourceRealm Access information stored in the database via JDBC data sources. JNDI Domain: JNDIREALM Access security verification information stored in LDAP-based directory servers via JNDI Provider.

Set resource security constraints

Add element in Web.xml

MZT protected test / test / * POST get mztadmin < / role-name> Basic test realm

Set JDBC Domain

Perform the following SQL statement in MySQL:

#########

# 用户 表 Create Table Users (user_name varchar (15) Not null primary key, user_pass varchar (15) not null;

# User role table create Table User_roles (user_name varchar (15) Not null, role_name varchar (15) Not null, primary key (user_name, role_name);

INSERT INTO Users VALUES ('MZT', 'Test'); INSERT INTO USER_ROLES VALUES ('mzt', 'mztadmin'); if there is any problem, contact me: WebMaster@bcxy.com

转载请注明原文地址:https://www.9cbs.com/read-111497.html

New Post(0)