简体   繁体   English

WSO2认证证书

[英]WSO2 authentication certificates

Is it possible to use authentication certificates to connect to WSO2 (CEP) Admin Services? 是否可以使用身份验证证书连接到WSO2(CEP)管理员服务?

https://localhost:9443/services/UserAdmin?wsdl

If yes, so how to do this? 如果是,那么该怎么做?

Accessing Admin Services APIs are common for all the WSO2 products. 访问Admin Services API对于所有WSO2产品都是通用的。 You have to use the public certificate used by the product inorder to communicate on SSL. 您必须使用产品使用的公共证书才能在SSL上进行通信。

You may refer the following sample 您可以参考以下示例

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();  
  }  
}

For more information, check here 欲了解更多信息,请点击这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM