9.7. 使用客户端证书配置授权
启用客户端证书身份验证意味着您不需要在客户端配置中指定 Data Grid 用户凭证,这意味着您必须将角色与客户端证书中的 Common Name (CN)字段关联。
前提条件
- 为客户端提供 Java 密钥存储,其中包含其公共证书或证书链的一部分,通常是公共 CA 证书。
- 配置 Data Grid Server 来执行客户端证书身份验证。
流程
-
在安全授权配置中启用
common-name-role-mapper。 从客户端证书中为通用名称(
CN)分配具有适当权限的角色。<cache-container name="certificate-authentication" statistics="true"> <security> <authorization> <!-- Declare a role mapper that associates the common name (CN) field in client certificate trust stores with authorization roles. --> <common-name-role-mapper/> <!-- In this example, if a client certificate contains `CN=Client1` then clients with matching certificates get ALL permissions. --> <role name="Client1" permissions="ALL"/> </authorization> </security> </cache-container>