0
A
回答
1
訪問管理服務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();
}
}
欲瞭解更多信息,請here
相關問題
- 1. 身份驗證證書
- 2. WSO2 ESB身份驗證
- 3. WSO2身份服務器身份驗證
- 4. WCF身份驗證-X509證書
- 5. 證書,加密和身份驗證
- 6. SSL證書和身份驗證
- 7. Kubernetes身份驗證與證書
- 8. 基於證書的身份驗證
- 9. 禁用WSO2證書驗證
- 10. 身份證書
- 11. 基於Jsch證書的身份驗證和登錄身份驗證取消
- 12. Java EE身份驗證,基本或表單AND證書身份驗證
- 13. 使用BASIC身份驗證和客戶端證書身份驗證
- 14. WCF證書身份驗證僅服務(無客戶端證書)
- 15. Azure中的客戶端證書身份驗證和CA證書
- 16. WSO2身份驗證服務器崩潰
- 17. wso2 am 2.0 ApiKeyValidator身份驗證錯誤
- 18. WSO2 ESB 4.5.0,身份驗證問題
- 19. WSO2 API管理器身份驗證
- 20. iOS ssl證書驗證 - 無法驗證服務器身份
- 21. 覆蓋客戶端證書身份驗證驗證
- 22. WCF客戶端證書驗證+ Windows身份驗證
- 23. WSO2身份驗證服務器:如何驗證用戶?
- 24. 通過WSO2身份驗證服務器從LDAP獲取驗證
- 25. WSO2身份服務器身份驗證與會話ID
- 26. WSO2身份服務器定製身份驗證上下文類
- 27. wso2身份服務器多因素身份驗證錯誤
- 28. 從小書籤檢查身份驗證
- 29. SOAP身份驗證
- 30. SaaS身份驗證