【发布时间】:2020-09-22 08:00:36
【问题描述】:
您好,我正在使用 wso2 IS 作为 APIM 3.1.0 的 KM。
我想在 wso2 ID 服务器中创建自定义属性查找器。我跟着这个链接 https://is.docs.wso2.com/en/5.9.0/develop/writing-a-custom-policy-info-point/
但最后我无法在 PDP 扩展视图下的 wso2 ID 服务器中看到自定义属性查找器。
我在 entitlement.properties 中包含以下数据源
DataSourceName=jdbc/testuserstore
KmarketJDBCAttributeFinder 中的 Init 方法如下所示:
@Override
public void init(Properties properties) throws Exception{
String dataSourceName = (String) properties.get("DataSourceName");
if(dataSourceName == null || dataSourceName.trim().length() == 0){
throw new Exception("Data source name can not be null. Please configure it in the entitlement.properties file.");
}
dataSource = (DataSource) InitialContext.doLookup(dataSourceName);
................
...............
我在 deployment.toml 文件中包含以下配置
[server]
hostname = "10.57.8.4"
node_ip = "10.57.8.4"
base_path = "https://$ref{server.hostname}:${carbon.management.port}"
serverDetails = "WSO2 IS as KM 5.10.0"
mode = "single"
userAgent = "WSO2 IS as KM 5.10.0"
[super_admin]
username = "admin"
password = "admin"
create_admin_account = true
[user_store]
type = "database_unique_id"
[database.apim_db]
type = "postgre"
url = "jdbc:postgresql://10.57.8.45:5432/wso2apimdb"
username = "wso2apim"
password = "password"
driver = "org.postgresql.Driver"
validationQuery = "SELECT 1"
[database.shared_db]
type = "postgre"
url = "jdbc:postgresql://10.57.8.45:5432/wso2shareddb"
username = "wso2shared"
password = "password"
driver = "org.postgresql.Driver"
validationQuery = "SELECT 1"
[[apim.gateway.environment]]
name = "Production and Sandbox"
type = "hybrid"
description = "This is a hybrid gateway that handles both production and sandbox token traffic."
service_url = "https://10.57.8.46:${mgt.transport.https.port}/services/"
username= "${admin.username}"
password= "${admin.password}"
[keystore.primary]
file_name = "idserver.jks"
password = "password"
alias = "idserver"
key_password = "password"
[admin_service.wsdl]
enable= true
[[datasource]]
id = "testuserstore"
#type = "postgre"
url = "jdbc:postgresql://10.57.8.45:5432/testuserstore"
username = "testuser"
password = "password"
#driver = "org.postgresql.Driver"
#validationQuery = "SELECT 1"
[[xacml.pip.attribute_designator]]
class = "org.xacmlinfo.xacml.pip.jdbc.KMarketJDBCAttributeFinder"
[xacml.pip.attribute_designator.properties]
DataSourceName = "jdbc/testuserstore"
[[event_listener]]
id = "mutual_tls_authenticator"
type = "org.wso2.carbon.identity.core.handler.AbstractIdentityHandler"
name = "org.wso2.carbon.identity.oauth2.token.handler.clientauth.mutualtls.MutualTLSClientAuthenticator"
order = "158"
enable = false
[[apim.throttling.url_group]]
traffic_manager_urls=["tcp://10.57.8.46:9611"]
traffic_manager_auth_urls=["ssl://10.57.8.46:9711"]
type = "loadbalance"
testuserstore 是在 postgresql DB 中创建的数据库。如链接中所述,我已经在数据库中创建了表。还将 postgres jdbc 驱动程序和 org.xacmlinfo.xacml.pip.jdbc-1.0.0.jar 包含在 /repository/components/lib 中。我正在使用 jdk 8 来构建 jar 文件。
请告诉我问题出在哪里。
【问题讨论】: