简体   繁体   English

从STS获取令牌时出错

[英]Error getting token from STS

I am getting an error from the following method call in WSO2 identity server STS client call, WSO2身份服务器STS客户端调用中的以下方法调用出现错误,

the call : 电话:

responseToken = stsClient.requestSecurityToken(servicePolicy,
                    STS_EPR, stsPolicy, RELYING_PARTY_SERVICE_EPR);

returns the following error. 返回以下错误。

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.init()V
    at org.apache.ws.security.WSSConfig.staticInit(WSSConfig.java:311)
    at org.apache.ws.security.WSSConfig.<init>(WSSConfig.java:327)
    at org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:336)
    at org.apache.ws.security.WSSConfig.getDefaultWSConfig(WSSConfig.java:345)
    at org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:363)
    at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:61)
    at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)
    at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
    at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
    at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:426)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:398)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
    at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)
    at org.apache.rahas.client.STSClient.requestSecurityToken(STSClient.java:164)
    at org.apache.rahas.client.STSClient.requestSecurityToken(STSClient.java:181)

This is obviously a wrong jar being included in the classpath. 显然,这是在类路径中包含了一个错误的jar。 I am running this against WSO2 identity server 4.1.0 and offending wss4j .jar version is wss4j_1.5.11.wso2v5.jar which comes with 4.1.0 IS. 我正在针对WSO2身份服务器4.1.0运行此程序,并且冒犯了wss4j .jar版本是4.1.0 IS附带的wss4j_1.5.11.wso2v5.jar。 Which version of .jar should I used to get rid of this issue? 我应该使用哪个版本的.jar摆脱此问题?

Side Note: I looked for source .jar files in the public Maven Repository of WSO2, but only binary .jar files are available there, why source .jar files are missing in the WSO2 public repository as WSO2 believes in open source software? 旁注:我在WSO2的公共Maven存储库中查找源.jar文件,但是那里只有二进制.jar文件,为什么WSO2相信开源软件,所以WSO2公共存储库中缺少源.jar文件?

Here I am referring specifically to http://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/ws/security/wss4j/1.5.11-wso2v5/ 在这里,我专门指的是http://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/ws/security/wss4j/1.5.11-wso2v5/

Go to identity servers bin folder [wso2is-4.1.0/bin] and issue the command "ant" to get the required libraries, (make sure you have installed Apache Ant) 转到身份服务器bin文件夹[wso2is-4.1.0 / bin]并发出命令“ ant”以获取所需的库,(确保已安装Apache Ant)

wso2is-4.1.0/bin$ ant wso2is-4.1.0 / bin $ ant

and then after building the ant script, go to the location wso2is-4.1.0/repository/lib and see the required libraries. 然后在构建ant脚本之后,转到位置wso2is-4.1.0 / repository / lib并查看所需的库。

rampart-policy_1.6.1-wso2v8.jar rampart-core_1.6.1-wso2v8.jar rampart-trust_1.6.1-wso2v8.jar wss4j_1.5.11-wso2v5.jar axis2_1.6.1-wso2v8.jar axiom_1.2.11-wso2v3.jar rampart-policy_1.6.1-wso2v8.jar rampart-core_1.6.1-wso2v8.jar rampart-trust_1.6.1-wso2v8.jar wss4j_1.5.11-wso2v5.jar axis2_1.6.1-wso2v8.jar axiom_1.2.11-wso2v3.jar

make sure you use above versions in your class path of the client. 确保在客户端的类路径中使用上述版本。

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

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