WSO2 API manager TryIt has zero key

I am using WSO2 API Manager and I added an API to it that was built in WSO2 ESB and when I try to use TryIt function I get the following error in the console log.

[2014-09-16 13: 59: 26,614] ERROR - API authentication error APIAuthenticationHandler org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException: Access error for API: / Sub, version: v1.0.0 with key: null at org.wso2.carbon.apimgt.gateway.handlers.security.oauth.OAuthAuthenticator.authenticate (OAuthAuthenticator.java:157) at org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler.handler.security.APIAuthenticationHandlerIAhandleReadication : 92) at org.apache.synapse.rest.API.process (API.java:285) at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI (RESTRequestHandler.java:83) at org.apache.synapse.rest. RESTRequestHandler.process (RESTRequestHandler.java:64) 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:processNonloEntityEnstorker at org.apache.synapse.transport.passthru.ServerWorker.run (ServerWorker.java:168) at org.apache.axis2.transport.base.threads.NativeWorkerPool $ 1.run (NativeWorkerPool.java:172) in java.util. concurrent.ThreadPoolExecutor.runWorker (Unknown source) at java.util.concurrent.ThreadPoolExecutor $ Worker.run (Unknown source) at java.lang.Thread.run (Unknown source)processNonEntityEnclosingRESTHandler (ServerWorker.java:344) at org.apache.synapse.transport.passthru.ServerWorker.run (ServerWorker.java:168) at org.apache.axis2.transport.base.threads.NativeWorkerPool (NativeWorkerPool : 172) at java.util.concurrent.ThreadPoolExecutor.runWorker (Unknown source) at java.util.concurrent.ThreadPoolExecutor $ Worker.run (Unknown source) at java.lang.Thread.run (Unknown source)processNonEntityEnclosingRESTHandler (ServerWorker.java:344) at org.apache.synapse.transport.passthru.ServerWorker.run (ServerWorker.java:168) at org.apache.axis2.transport.base.threads.NativerunerPool (NativeWorkerPool : 172) at java.util.concurrent.ThreadPoolExecutor.runWorker (Unknown source) at java.util.concurrent.ThreadPoolExecutor $ Worker.run (Unknown source) at java.lang.Thread.run (Unknown source)run (Unknown source)run (Unknown source)

I am trying to send a GET request and there are no parameters for this API and in the authorization field that I entered

Bearer XXXACCESS+TOKEN+GOES+HEREXXXX 

      

When testing this from an extended REST client or a REST client in store, it works. I changed the port numbers in various files (authorization, login, token, revocation) according to my port offset. I also configured the API Store addresses in api-manager.xml.

+3


source to share


1 answer


When you add this particular resource to your API, also select the "OPTIONS" verb. Otherwise, this error will be listed.

enter image description here

Also, check that your / etc / hosts entries direct 'localhost' to '127.0.0.1' instead of your device's IP address. In this case, please open

    {API-M installation DIR}/repository/conf/api-manager.xml

      

And, change the Swagger related section accordingly by adding your IP address (or hostname)





    <!--Configuration to enable/disable sending CORS headers from the Gateway-->
    <Enabled>true</Enabled>

    <!--The value of the Access-Control-Allow-Origin header. Default values are 
        API Store addresses, which is needed for swagger to function.-->
    <Access-Control-Allow-Origin>https://localhost:9443,http://localhost:9763</Access-Control-Allow-Origin>

    <!--Configure Access-Control-Allow-Headers-->
    <Access-Control-Allow-Headers>authorization,Access-Control-Allow-Origin,Content-Type</Access-Control-Allow-Headers>

</CORSConfiguration>

      

to this (add your own server IP instead),



    <!--Configuration to enable/disable sending CORS headers from the Gateway-->
    <Enabled>true</Enabled>

    <!--The value of the Access-Control-Allow-Origin header. Default values are 
        API Store addresses, which is needed for swagger to function.-->
    <Access-Control-Allow-Origin>https://192.168.56.101:9443,http://192.168.56.101:9763</Access-Control-Allow-Origin>

    <!--Configure Access-Control-Allow-Headers-->
    <Access-Control-Allow-Headers>authorization,Access-Control-Allow-Origin,Content-Type</Access-Control-Allow-Headers>

</CORSConfiguration>

      

The above answer assumes that you have not added any port offset to the API manager. If you did, you must also change the port value (just add that value to the existing port value) in the above configuration.

Thank.

-Chathura

+1


source







All Articles