Java 客户端策略的密钥斗篷SPI?

Java 客户端策略的密钥斗篷SPI?,java,keycloak,Java,Keycloak,我正在尝试为客户端策略实现一个SPI,以替换我在js中的策略 我实现了类似于和PolicyProviderFactory的PolicyProvider,然后将我的jar复制到standalone/deployments,如中所述 我可以在日志中看到已经部署了jar: 08:17:02,647 INFO [stdout] (MSC service thread 1-3) about to start org.keycloak.services.util.JsonConfigProvider$Js

我正在尝试为客户端策略实现一个
SPI
,以替换我在
js
中的策略

我实现了类似于和
PolicyProviderFactory的
PolicyProvider
,然后将我的
jar
复制到
standalone/deployments
,如中所述

我可以在日志中看到已经部署了jar:

08:17:02,647 INFO  [stdout] (MSC service thread 1-3) about to start org.keycloak.services.util.JsonConfigProvider$JsonScope@266abf6d                                                                             
08:17:02,682 WARN  [org.keycloak.services] (MSC service thread 1-3) KC-SERVICES0047: myEvListener (example.myProvider.EvListenerProviderFactory) is implementing the internal SPI eventsListener. This SPI is internal and may change without notice                                                                                                                                                                               
08:17:02,692 WARN  [org.keycloak.services] (MSC service thread 1-3) KC-SERVICES0047: myRolePolicy (example.myProvider.MyPolicyProviderFactory) is implementing the internal SPI policy. This SPI is internal and may change without notice                                                                                                                                                                                         
08:17:02,814 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0010: Deployed "myPolicyProvider.jar" (runtime-name : "myPolicyProvider.jar")  
现在,我找不到使用我的
SPI

在服务器信息中,我可以看到策略提供程序中列出的策略(
my role policy
my js policy
):


如果有人能为我指出正确的方向,我将不胜感激。

为了创建策略,需要向以下地址发出POST请求:

http://${host}:${port}/auth/realms/${realm}/clients/${clientId}/authz/resource server/policy/${policyId}
其中,
PolicyProviderFactory

public String getId() {
    return "myId";
}
文章的正文应该是json

{
    "decisionStrategy": "AFFIRMATIVE",
    "logic": "POSITIVE",
    "name": "policyName",
    .... // other fields required in your policy implementation
}
一个curl请求示例:

curl——请求发布\
--url http://${host}:${port}/auth/admin/realms/${realm}/clients/${clientId}/authz/resource server/policy/${policyId}\
--标头'authorization:Bearer${token}'\
--标题“内容类型:应用程序/json”\
--数据“{“决策策略”:“肯定”,“逻辑”:“肯定”,“名称”:“是管理员”,“角色”:“管理员”}”

您是否能够修复此问题?遇到了类似的问题。还有,如何查看服务器信息页面?如果你已经解决了这个问题,请添加信息。我刚刚添加了一个问题的答案,服务器信息可以在右上角找到,如此屏幕截图所示