3

I installed the latest WS02 API Manager, 1.6.0. I followed the directions and just did the plain install, nothing special. When I create an API, publish it, subscribe to it, create an Access Token, and try to access it, I am seeing the following error (I replaced the access key, but it is displaying):

[2014-02-03 13:25:47,850] ERROR - APIAuthenticationHandler API authentication failure
org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException: Access failure for API: /weather, version: 1 with key: access_key

It seems that the API and access key are not getting connected. Is there something else that I have to do to make that happen? I am not using a separate database for the Key Manager, just whatever comes with the install which is a memory DB I assume. I have tried this from Advanced Rest Client in Chrome. I'm guessing something's just not configured correctly, but I don't see any errors in the start-up. I just see a few warnings along these lines:

[2014-02-03 13:25:01,262]  WARN - DefaultSchemaGenerator We don't support method overloading. Ignoring [validateAudience Restriction]

Here is the full stack trace for the error:

[2014-02-03 13:25:47,850] ERROR - APIAuthenticationHandler API authentication failure
org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException: Access failure for API: /weather, version: 1 with key: access_key
        at org.wso2.carbon.apimgt.gateway.handlers.security.oauth.OAuthAuthenticator.authenticate(OAuthAuthenticator.jav
a:139)
        at org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler.handleRequest(APIAuthenticationHand
ler.java:92)
        at org.apache.synapse.rest.API.process(API.java:285)
        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:220)
        at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
        at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:336
)
        at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:168)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:662)
Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
  • How did you execute your API? can you provide your request URL? – Ratha Feb 03 '14 at 19:41
  • Did you publish the service? Did you subscribe on the service? Did you generate a access-token? Did you sent the access-token in the Soap header (Authentication: bearer xxx..access-token..xxx? – Marc Feb 03 '14 at 21:10
  • What's the response you got this request? It seems you are providing the Authorization header correctly, but the token you are using is invalid/expired. See the link on subscribing to an API and the Applications concept. You generate a token for an application not for an API. An Application is a (logical) collection of APIs. http://docs.wso2.org/display/AM160/Subscribing+to+APIs – Kasun Gajasinghe Feb 03 '14 at 23:05
  • Thank you for your responses. This is the request URL that I used: http://localhost:8280/weather/1. I did publish the service, subscribe to it, generate an access token and send the access token in the header. If I look under subscriptions in the API Store, the weather API is there for the access token that I'm using. The response: 900906 No matching resource found in the API for the given request Access failure for API: /weather, version: 1 with key: access_token – user3267144 Feb 04 '14 at 14:36
  • I figured it out. Somewhere along the way I had checked a radio box in Advanced Rest Client for "delete" instead of "get". I didn't even think to check it originally because I assumed it was still on "get". Thank you for all of your help. I wanted to come post my answer in case anyone else runs into a similar problem. Just missed one small but very important detail. – user3267144 Feb 04 '14 at 14:53

0 Answers0