OAuth Authorize URL 404

Okay so that gave me some pointers in terms of places to look, upon investigating the logs of the gateway API i could see a problem:

time="Mar 20 13:16:38" level=warning msg="Authorise request is missing key_rules in params, policy will be required!"

So i’ve tried dumping in the key rules from the online sample and I get:

time="Mar 20 13:26:02" level=warning msg="Attempted key creation with mismatching Org ID"

I’ve then reworked the request to update the orgID to the one the user is a part of, plus ive also updated the access rights to align to the correct api so it looks like this:

{
   "allowance":999,
   "rate":1000,
   "per":60,
   "expires":0,
   "quota_max":-1,
   "quota_renews":1406121006,
   "quota_remaining":0,
   "quota_renewal_rate":60,
   "org_id":"58cf83288fbbe10001a7c674",
   "access_rights":{
      "aadfd1bfeee64be86751e3cb112e15b8":{
         "api_name":"OAuthDemoAPI",
         "api_id":"aadfd1bfeee64be86751e3cb112e15b8",
         "versions":[
            "Default"
         ],
         "allowed_urls":null
      }
   }
}

Which after a bit of URL encoding makes my request look like this:

curl -vX POST -H "Authorization: a87d8efe939f41f66016f1a2e19fe7bd" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d 'response_type=code&client_id=06b4277cc5724d585445e9cb5cd7e2de&redirect_uri=https%3A%2F%2Fwww.getpostman.com%2Foauth2%2Fcallback&key_rules=%7B%0A%20%20%20%22allowance%22%3A999%2C%0A%20%20%20%22rate%22%3A1000%2C%0A%20%20%20%22per%22%3A60%2C%0A%20%20%20%22expires%22%3A0%2C%0A%20%20%20%22quota_max%22%3A-1%2C%0A%20%20%20%22quota_renews%22%3A1406121006%2C%0A%20%20%20%22quota_remaining%22%3A0%2C%0A%20%20%20%22quota_renewal_rate%22%3A60%2C%0A%20%20%20%22org_id%22%3A%2258cf83288fbbe10001a7c674%22%2C%0A%20%20%20%22access_rights%22%3A%7B%0A%20%20%20%20%20%20%22aadfd1bfeee64be86751e3cb112e15b8%22%3A%7B%0A%20%20%20%20%20%20%20%20%20%22api_name%22%3A%22OAuthDemoAPI%22%2C%0A%20%20%20%20%20%20%20%20%20%22api_id%22%3A%22aadfd1bfeee64be86751e3cb112e15b8%22%2C%0A%20%20%20%20%20%20%20%20%20%22versions%22%3A%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Default%22%0A%20%20%20%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%20%20%20%22allowed_urls%22%3Anull%0A%20%20%20%20%20%20%7D%0A%20%20%20%7D%0A%7D' \ http://192.168.99.100:3000/api/apis/oauth/aadfd1bfeee64be86751e3cb112e15b8/authorize-client/

But this now ends up with a 404 error again, plus nothing in the log output in docker logs

So basically I think the endpoint is correct, however something is wrong with the payload, but for some reason its returning a 404 (which was a bit of a red herring), however the logs I can see are quite granular, so im wondering if maybe there is a way to get more detailed logs so i can try to see what its not happy with? If I can debug further I reckon I cant find out whats going on, then maybe its worth logging a minor bug to address the 404 and lack of errors on the api output?