4.3. 手动配置 REST 身份验证
明确配置 REST 连接器身份验证,以覆盖 Data Grid 服务器用于安全域的默认 HTTP 身份验证机制。
流程
-
在 REST 连接器配置中添加
身份验证
定义。 - 指定 REST 连接器用来进行身份验证的 Data Grid 安全域。
- 指定要使用的 REST 端点的身份验证机制。
4.3.1. REST 身份验证配置
带有 BASIC 和 DIGEST 验证的 REST 连接器
<endpoints xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:server:12.1 https://infinispan.org/schemas/infinispan-server-12.1.xsd" xmlns="urn:infinispan:server:12.1" socket-binding="default" security-realm="default"> <rest-connector> <!-- Specifies SASL mechanisms to use for authentication. --> <authentication mechanisms="DIGEST BASIC"/> </rest-connector> </endpoints>
带有 Kerberos 验证的 REST 连接器
<endpoints xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:server:12.1 https://infinispan.org/schemas/infinispan-server-12.1.xsd" xmlns="urn:infinispan:server:12.1" socket-binding="default" security-realm="default"> <rest-connector> <!-- Enables the `SPENGO` mechanism for Kerberos authentication and specifies an identity for the server. --> <authentication mechanisms="SPNEGO" server-principal="HTTP/localhost@INFINISPAN.ORG"/> </rest-connector> </endpoints>
4.3.2. REST 端点身份验证机制
Data Grid 通过 REST 连接器支持以下验证机制:
身份验证机制 | 描述 | 相关详情 |
---|---|---|
|
以纯文本格式使用凭据。您应该只使用带有加密连接的 |
对应于 |
|
使用哈希算法和非ce 值。REST 连接器支持 |
对应于 |
|
使用 Kerberos 票据并需要一个 Kerberos 域控制器。您必须在 realm 配置中添加对应的 |
对应于 |
|
使用 OAuth 令牌并需要一个 |
对应于 |
| 使用客户端证书。 |
与 |