0

I have configured the wso2 IDM as Key manager as per the documentation but getting the below error :

When I'm trying to access the API getting the below response on the API manager console.

<ams:fault xmlns:ams="http://wso2.org/apimanager/security"> <ams:code>900900</ams:code> <ams:message>Unclassified Authentication Failure</ams:message> <ams:description>Error while accessing backend services for API key validation</ams:description> </ams:fault>

` https://localhost:9444/services/

    <!-- Admin username for API key manager. -->
    <Username>admin</Username>
    <!-- Admin password for API key manager. -->
    <Password>admin</Password>

    <!-- Configurations related to enable thrift support for key-management related communication.
         If you want to switch back to Web Service Client, change the value of "KeyValidatorClientType" to "WSClient".
         In a distributed environment;
         -If you are at the Gateway node, you need to point "ThriftClientPort" value to the "ThriftServerPort" value given at KeyManager node.
         -If you need to start two API Manager instances in the same machine, you need to give different ports to "ThriftServerPort" value in two nodes.
         -ThriftServerHost - Allows to configure a hostname for the thrift server. It uses the carbon hostname by default.
         -The Gateway uses this parameter to connect to the key validation thrift service. -->
    <KeyValidatorClientType>WSClient</KeyValidatorClientType>
    <ThriftClientConnectionTimeOut>10000</ThriftClientConnectionTimeOut>
    <!--ThriftClientPort>10397</ThriftClientPort-->

    <EnableThriftServer>false</EnableThriftServer>
    <ThriftServerHost>localhost</ThriftServerHost>
    <!--ThriftServerPort>10397</ThriftServerPort-->

    <!--ConnectionPool>
        <MaxIdle>100</MaxIdle>
        <InitIdleCapacity>50</InitIdleCapacity>
    </ConnectionPool-->
    <!-- Specifies the implementation to be used for KeyValidationHandler. Steps for validating a token can be controlled by plugging in a 
         custom KeyValidation Handler -->
    <KeyValidationHandlerClassName>org.wso2.carbon.apimgt.keymgt.handlers.DefaultKeyValidationHandler</KeyValidationHandlerClassName>
</APIKeyValidator>

`

[2018-03-27 15:05:42,384] DEBUG - API authentication failed with error 900900 {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler} org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException: Error while accessing backend services for API key validation at org.wso2.carbon.apimgt.gateway.handlers.security.keys.WSAPIKeyDataStore.getAllURITemplates(WSAPIKeyDataStore.java:77) at org.wso2.carbon.apimgt.gateway.handlers.security.APIKeyValidator.getAllURITemplates(APIKeyValidator.java:670) at org.wso2.carbon.apimgt.gateway.handlers.security.APIKeyValidator.doGetAPIInfo(APIKeyValidator.java:522) at org.wso2.carbon.apimgt.gateway.handlers.security.APIKeyValidator.findMatchingVerb(APIKeyValidator.java:494) at org.wso2.carbon.apimgt.gateway.handlers.security.APIKeyValidator.getResourceAuthenticationScheme(APIKeyValidator.java:286) at org.wso2.carbon.apimgt.gateway.handlers.security.oauth.OAuthAuthenticator.authenticate(OAuthAuthenticator.java:119) at org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler.handleRequest(APIAuthenticationHandler.java:117) at org.apache.synapse.rest.API.process(API.java:325) at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:90) at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:69) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:304) at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:78) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:325) at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:158) 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.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException: Error while accessing backend services for API key validation at org.wso2.carbon.apimgt.gateway.handlers.security.keys.APIKeyValidatorClient.getAllURITemplates(APIKeyValidatorClient.java:171) at org.wso2.carbon.apimgt.gateway.handlers.security.keys.WSAPIKeyDataStore.getAllURITemplates(WSAPIKeyDataStore.java:75) ... 18 more Caused by: java.lang.NullPointerException at org.wso2.carbon.apimgt.gateway.handlers.security.keys.APIKeyValidatorClient.getAllURITemplates(APIKeyValidatorClient.java:165) ... 19 more

  • Questions seeking debugging help ("**why isn't this code working?**") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it **in the question itself**. Questions without a **clear problem statement** are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – André Mar 27 '18 at 10:02
  • I'd recommend to check the URLs you've entered to the AM's api-manager. xml – gusto2 Mar 27 '18 at 11:11
  • Same reported in https://stackoverflow.com/questions/39217448/wso2-apim-2-0-clustering-deployment-issue-when-try-api-console-from-api-store – Pubci Mar 27 '18 at 11:30
  • I had checked that but its in the previous version , so I'm assuming its already fixed in the latest version 2.1.0 – user3868307 Mar 27 '18 at 12:24

0 Answers0