Forum Discussion

tonante727's avatar
tonante727
Occasional Contributor
2 years ago
Solved

Using AWS Gateway API keys for testing real servers on Swagger UI

HI I just need to make sure that I am understanding the testing for Swagger Hub UI:

  • I have generated an AWS Gateway key for testing internally and also using Postman externally and want to test real servers on Swagger UI not mocks.
  • I then take that API Key and in Swagger Hub UI I click on the authorize button that is near the upper right hand corner  next to the server drop downs.
  • I  close the Authorize dialog box (See photo below)
  • In my YAML definitions I have declared   both my developer and production urls
  • I added my security scheme and security definition.
  • Q) I am wondering why I receive 403 forbidden responses when I test any of my access methods (Post, Get, Put) if these steps are correct? Thanks
  1.  

  • tonante727's avatar
    tonante727
    2 years ago

    OK @chichepo , I solved it but there must be a better way of making the server URL more covert.

    The steps for testing this is relatively easy to set up:

    • In the sever:: url area  of the definitions file, just add the full gateway endpoint including the region.
    • Put the gateway's API key into the Authorized lock button next to the servers drop down and close its dialog box as soon as you add the api key.
    • Test your access endpoints.

3 Replies

    • tonante727's avatar
      tonante727
      Occasional Contributor

      Yes chichepo  I have enclosed a screen scrape of a Get test in Postman.

      PREVIEW
       I can test in both AWS API Gateway to test the proxy lambda and I can also use Postman. I was successfully able to Get , Post, and Put data from and to my Dynamo DB table. I verified it worked.
      HOwever, for some reason even though I have Authorized the API Key and the bottom of the Swagger Hub definitions YAML contains the Gateways APP ID, I still have not been able to test the live AWS Development Gateway service. Maybe I am still doing something incorrect?  Thaks
      chichepo
      PREVIEW
       
       
       

      chichepo wrote:

      Hi tonante727 
      you tried with postman and it works?




      • tonante727's avatar
        tonante727
        Occasional Contributor

        OK @chichepo , I solved it but there must be a better way of making the server URL more covert.

        The steps for testing this is relatively easy to set up:

        • In the sever:: url area  of the definitions file, just add the full gateway endpoint including the region.
        • Put the gateway's API key into the Authorized lock button next to the servers drop down and close its dialog box as soon as you add the api key.
        • Test your access endpoints.