3.3. 令牌域

令牌域使用外部服务来验证令牌,并需要与 RFC-7662 (OAuth2 Token Introspection)兼容的提供程序,如 Red Hat SSO。

端点身份验证机制

当您将 Data Grid Server 配置为使用令牌域时,您必须将端点配置为使用以下身份验证机制:

  • hot Rod (SASL): OAUTHBEARER
  • REST (HTTP): Bearer

令牌域配置

<security 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">
   <security-realms>
      <security-realm name="default">
         <!-- Specifies the URL of the authentication server. -->
         <token-realm name="token"
                      auth-server-url="https://oauth-server/auth/">
            <!-- Specifies the URL of the token introspection endpoint. -->
            <oauth2-introspection
                    introspection-url="https://oauth-server/auth/realms/infinispan/protocol/openid-connect/token/introspect"
                    client-id="infinispan-server"
                    client-secret="1fdca4ec-c416-47e0-867a-3d471af7050f"/>
         </token-realm>
      </security-realm>
   </security-realms>
</security>