When invoking a secure proxy service you might come accross the following exception.
ERROR - AxisEngine The security token could not be authenticated or authorized; nested exception is: javax.security.auth.callback.UnsupportedCallbackException: Check failed : System error org.apache.axis2.AxisFault: The security token could not be authenticated or authorized; nested exception is: javax.security.auth.callback.UnsupportedCallbackException: Check failed : System error at org.apache.rampart.handler.RampartReceiver.setFaultCodeAndThrowAxisFault(RampartReceiver.java:180) at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:95) 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.receive(AxisEngine.java:167) at org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.doSOAP(MultitenantMessageReceiver.java:281) at org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processRequest(MultitenantMessageReceiver.java:226) at org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:78) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:395) at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:142) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.ws.security.WSSecurityException: The security token could not be authenticated or authorized; nested exception is: javax.security.auth.callback.UnsupportedCallbackException: Check failed : System error at org.apache.ws.security.processor.UsernameTokenProcessor.handleUsernameToken(UsernameTokenProcessor.java:180) at org.apache.ws.security.processor.UsernameTokenProcessor.handleToken(UsernameTokenProcessor.java:61) at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:332) at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:249) at org.apache.rampart.RampartEngine.process(RampartEngine.java:214) at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:92) ... 14 more Caused by: javax.security.auth.callback.UnsupportedCallbackException: Check failed : System error at org.wso2.carbon.security.util.ServicePasswordCallbackHandler.handle(ServicePasswordCallbackHandler.java:112) at org.apache.rampart.TokenCallbackHandler.handle(TokenCallbackHandler.java:116) at org.apache.ws.security.processor.UsernameTokenProcessor.handleUsernameToken(UsernameTokenProcessor.java:168) ... 19 more [2016-02-09 15:15:53,616] ERROR - ServerWorker Error processing POST reguest for : /services/t/test.com/SimpleProxy.SimpleProxyHttpSoap11Endpoint. Error detail: org.apache.axiom.om.impl.dom.ElementImpl cannot be cast to org.apache.axiom.soap.SOAPHeaderBlock. java.lang.ClassCastException: org.apache.axiom.om.impl.dom.ElementImpl cannot be cast to org.apache.axiom.soap.SOAPHeaderBlock at org.wso2.carbon.security.pox.POXSecurityHandler.isSOAPWithoutSecHeader(POXSecurityHandler.java:362) at org.wso2.carbon.security.pox.POXSecurityHandler.invoke(POXSecurityHandler.java:102) 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.sendFault(AxisEngine.java:515) at org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.doSOAP(MultitenantMessageReceiver.java:325) at org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processRequest(MultitenantMessageReceiver.java:226) at org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:78) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:395) at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:142) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
Possible Reason
One possible reason for this error is that the Authentication details (User Credentials) you are parsing are incorrect. The above exception doesn't give any indication about invalid user credentials so the users might get misleaded.
Remedy
If you see the above exception double check the user credentials you are parsing in the WSS header. Also check the allowed roles and the policy. This might be the root cause of the issue.
No comments:
Post a Comment