我正在尝试 WS02 API Manager,但在发送 REST API 调用时出现以下错误 -
<ams:fault xmlns:ams="http://wso2.org/apimanager/security">
<ams:code>900901</ams:code>
<ams:message>Authentication Failure</ams:message>
<ams:description>Authentication failure for API: /api, version: 1 with key: h0Bwxc94aBf6RJVnhtZeBqwp_hIa</ams:description>
</ams:fault>
密钥是用户的生产密钥,并且该用户订阅了此 API。
原始请求如下所示
GET http://192.168.13.83:8280/api/1 HTTP/1.1
Accept-Encoding: gzip,deflate
Authorization: Bearer h0Bwxc94aBf6RJVnhtZeBqwp_hIa
堆栈跟踪显示 -
[2012-07-06 14:38:40,210] ERROR - APIAuthenticationHandler API authentication failure
org.wso2.carbon.apimgt.handlers.security.APISecurityException: Authentication failure for API: /api, version: 1 with key: h0Bwxc94aBf6RJVnhtZeBqwp_hIa
at org.wso2.carbon.apimgt.handlers.security.oauth.OAuthAuthenticator.authenticate(OAuthAuthent icator.java:77)
at org.wso2.carbon.apimgt.handlers.security.APIAuthenticationHandler.handleRequest(APIAuthenti cationHandler.java:82)
at org.apache.synapse.rest.API.process(API.java:251)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:63)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment .java:180)
at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83 )
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
at org.apache.synapse.transport.nhttp.util.RESTUtil.processGetAndDeleteRequest(RESTUtil.java:1 39)
at org.apache.synapse.transport.nhttp.DefaultHttpGetProcessor.processGetAndDelete(DefaultHttpG etProcessor.java:464)
at org.wso2.carbon.transport.nhttp.api.NHttpGetProcessor.process(NHttpGetProcessor.java:296)
at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:258)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
谁能告诉我这里有什么问题。