[英]WSO2 authentication certificates
是否可以使用身份驗證證書連接到WSO2(CEP)管理員服務?
https://localhost:9443/services/UserAdmin?wsdl
如果是,那么該怎么做?
訪問Admin Services API對於所有WSO2產品都是通用的。 您必須使用產品使用的公共證書才能在SSL上進行通信。
您可以參考以下示例
import org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException;
import org.wso2.carbon.authenticator.stub.LogoutAuthenticationExceptionException;
import org.wso2.carbon.service.mgt.stub.types.carbon.ServiceMetaData;
import org.wso2.carbon.service.mgt.stub.types.carbon.ServiceMetaDataWrapper;
import java.rmi.RemoteException;
public class ListServices {
public static void main(String[] args)
throws RemoteException, LoginAuthenticationExceptionException,
LogoutAuthenticationExceptionException {
System.setProperty("javax.net.ssl.trustStore", "$CEP_HOME/repository/resources/security/wso2carbon.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");
System.setProperty("javax.net.ssl.trustStoreType", "JKS");
String backEndUrl = "https://localhost:9443";
LoginAdminServiceClient login = new LoginAdminServiceClient(backEndUrl);
String session = login.authenticate("admin", "admin");
ServiceAdminClient serviceAdminClient = new ServiceAdminClient(backEndUrl, session);
ServiceMetaDataWrapper serviceList = serviceAdminClient.listServices();
System.out.println("Service Names:");
for (ServiceMetaData serviceData : serviceList.getServices()) {
System.out.println(serviceData.getName());
}
login.logOut();
}
}
欲了解更多信息,請點擊這里
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.