This topic describes the concept and examples of the identity authentication feature. The identity authentication feature is used to verify the identity of users logging into the database, confirm whether they can be associated with a database user, and enforce security controls on data access activities based on the associated user's permissions.
User authentication in OceanBase AI Database refers to the process where the client provides valid credentials when attempting to access the OceanBase server. If the OceanBase server confirms that the provided credentials are valid, it allows the client to access OceanBase AI Database. OceanBase AI Database uses a protocol called the MySQL Authentication Protocol (MAPI) for user authentication. It is based on the MySQL client account on the client machine to complete the authentication. That is, only clients with the correct username and password can connect to the OceanBase server. When the client sends a connection request, the OceanBase server sends a random identifier to the client. The client must use the correct username and password to decode this identifier and then send the decoded result back to the server. If the result is correct, the OceanBase server allows the client to connect.
Example
A user consists of a user_name and a host. The following example creates three users with the same username:
create user 'u1'@'%' identified by '*******';
create user 'u1'@'10.xxx.xxx.1' identified by '*******';
create user 'u1'@'10.xxx.xxx.2' identified by '*******';
The parameters are described as follows:
%: Allows any client IP to connect to the tenant.10.xxx.xxx.1: Allows only the IP10.xxx.xxx.1to connect to the tenant.10.xxx.xxx.2: Allows only the IP10.xxx.xxx.2to connect to the tenant.
When a user logs in, the OBServer node controls the login based on the matching of user_name, client_ip, and password.