繁体   English   中英

WSO2身份服务器-PEP的权利-错误:Web服务登录时无效的远程地址

[英]WSO2 Identity Server - Entitlement for PEP - Error: Invalid Remote Address at Web Service Login

当使用博客中发布的示例测试对WSO2版本5服务器的编程授权(登录)时,出现以下错误消息:

.Jul 15, 2015 2:50:41 PM org.apache.axiom.util.stax.dialect.StAXDialectDetector detectDialect
WARNING: Unable to determine dialect of the StAX implementation at jar:file:/home/claudef/tmp/wso2/entitlement/lib/axiom_1.2.11.wso2v4.jar!/
 org.apache.axis2.AxisFault: Authentication Failed : Invalid remote address passed - https://ralbz001098.cloud.dst.ibm.com:9443/

我的代码如下:

System.setProperty("javax.net.ssl.trustStore",
                           "/home/claudef/tmp/wso2/entitlement/resources/wso2carbon.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "xxxxxxxxx");

//initialize authentication admin stub
UnitTest1 remoteEntitlementClient = new UnitTest1();
//login using authentication admin stub providing valid credentials
// add IP address as a third argument is not working!
//  see http://stackoverflow.com/questions/30452073/wso2-identity-server-authenticationadmin-api-authentication-failed
// remoteEntitlementClient.login("admin", "xxxxxxxx","localhost");
remoteEntitlementClient.login("admin", "xxxxxxxx");
//initialize entitlement service stub with obtained authentication cookie
remoteEntitlementClient.initUnitTest1();

链接的库:

. org.wso2.carbon.authenticator.stub-4.2.0.jar
. org.wso2.carbon.identity.entitlement.common-4.2.1.jar
. org.wso2.carbon.identity.entitlement.stub-4.2.1.jar
. org.wso2.carbon.identity.entitlement.ui-4.0.0.jar 
. axiom_1.2.11.wso2v4.jar

预先感谢您的支持。

找到了解决方案。 第三个参数是登录名中必需的,并且必须采用本地IP地址(例如“ localhost”)或有效IP地址(例如9.XXX)的格式。添加它的正确位置是在login部分中,例如:

boolean loggedIn = authstub.login(username, password, "9.x.x.xx"); 

登录代码现在正在工作。

暂无
暂无

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

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