使用 Java API 将角色安全应用于 WSO2 ESB 代理 [英] Apply Role security to WSO2 ESB Proxy using Java API
问题描述
我正在寻找一种使用 Java API 在 WSO2 ESB 的现有代理 WSDL 上应用基于角色的安全性的方法.
I am looking for a way to apply Role based security on existing Proxy WSDLs of WSO2 ESB using Java API.
使用 org.wso2.carbon.proxyadmin.stub.ProxyServiceAdminStub 我可以设法为不安全的代理服务启用安全性,但无法找到应用基于角色的安全性的方法(请注意角色来自 WSO2 身份服务器).我知道可以使用 Wso2 ESB 管理控制台执行此操作,但是有没有办法通过 Java API 处理它?任何可用的 Carbon 后端网络服务?
Using org.wso2.carbon.proxyadmin.stub.ProxyServiceAdminStub I could manage to enable security for unsecured proxy service, but unable to find a way to apply Role based security (please note the roles are coming from WSO2 Identity Server). I understand it's possible to perform this action with Wso2 ESB management console, but is there is a way to handle it through Java API? Any carbon backend web service available?
推荐答案
这有助于禁用和启用安全性以及为给定代理服务应用基于角色的安全性.这就是我一直在寻找的.希望它可以帮助那里的人...
This helped in disabling and enabling security as well as applying Role based security for a given proxy service. This is what I was looking for. Hope it helps some one out there...
public void applySecurity(String serviceName, String policyId,
String[] userGroups, String[] trustedKeyStoreArray,
String privateStore)
throws SecurityAdminServiceSecurityConfigExceptionException, RemoteException {
ApplySecurity applySecurity;
applySecurity = new ApplySecurity();
applySecurity.setServiceName(serviceName);
applySecurity.setPolicyId("scenario" + policyId);
applySecurity.setTrustedStores(trustedKeyStoreArray);
applySecurity.setPrivateStore(privateStore);
applySecurity.setUserGroupNames(userGroups);
securityAdminServiceStub.applySecurity(applySecurity);
log.info("Security Applied");
}
这篇关于使用 Java API 将角色安全应用于 WSO2 ESB 代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!