aws-samples / api-gateway-secure-pet-store

Amazon API Gateway sample using Amazon Cognito credentials through AWS Lambda
Apache License 2.0
307 stars 113 forks source link

Test post method for inserting pets with temporaty security credential in Postman #2

Closed mingqin1 closed 9 years ago

mingqin1 commented 9 years ago

Hi: I deployed codes on AWS and users were registered as cognito pool. The URL( https://...../test/login) post method returned this JSON.
Can I use Postman to test https://...../test/pets with security credential to insert new pet?
what are the custom http headers ( Authorization, Credential, SignedHeaders , Signature) I need to set up?

{ "identityId": "us-west-2:474913db-b0bd-47f0cb3dbe43b", "token": "eyJraWQiOiJ1cy1lYXN0LTExIiwidHlwIjoiSldTIiwiYWxnIjoiUlM1MTIifQ.eyJzdWIiOiJ1cy1lYXN0LTE6NDc0OTEzZGItYjBiZC00NzFlLThiZmUtNGYwY2IzZGJlNDNiIiwiYXVkIjoidXMtZWFzdC0xOjNjMmIyZjI3LTU2ZGQtNGM5MS1hNmM5LTFhNTk4NjUwZjU3ZiIsImFtciI6WyJhdXRoZW50aWNhdGVkIiwicGV0U3RvcmVBdXRoZW50aWNhdGlvblByb3ZpZGVyIiwicGV0U3RvcmVBdXRoZW50aWNhdGlvblByb3ZpZGVyOnVzLWVhc3QtMTozYzJiMmYyNy01NmRkLTRjOTEtYTZjOS0xYTU5ODY1MGY1N2Y6dGVzdCJdLCJpc3MiOiJodHRwczovL2NvZ25pdG8taWRlbnRpdHkuYW1hem9uYXdzLmNvbSIsImV4cCI6MTQ0NDQ5MTE2NiwiaWF0IjoxNDQ0NDkwMjY2fQ.PcCVdZidyeumwJUrfvZdaOhS0OsvO6aMaAe4eBMF8mTK7txyFtwr0KTPtFrLtWprP7h6HabIiJUiLGVOh52fE74ngmeNlihgkw7vSjGsisXzQMEfVF5YjyMyKVn_BOYxy7B-58-EFeDAFYXbmNg2IQXsGQPyp28i7dFQh7gPgAW9FJuRFe1WgxcR_asT_Zrko_dVy59yEqclUtgyWktsV1v8zU1S0o1CsnLifD2SEWvjDA09RYqJf-Q2nkbjRO1ToVZXEdYLdx_ApQmPWRo-ISdZ8PntqlJvx0whP5aoqbAwNh6k9ZqMQw", "credentials": { "accessKey": "ASIAJ5T4LTYBM5NA", "secretKey": "G4ddpPtc6RZkuzb5PV6hsV860QjAPP5W4M", "sessionToken": "AQoDYXdzEKj//////////wEakAUqSPwuGYLRKnjXPY08UmpP4/Cr8Jizr2dO7vrL9hijQjGjOo3IPMBArc9TFK+lCyoHmqEa2Isp7pWe2A07F4vFBHX1Oumf5jTzdY/U7nUpiGH57Sb2+74Gebg0agMKAdj0o5Gp2aqSeP7Mt//WHZiApIq1+AyTzbP0GgQKMrJxSe9zxAmv3nZuGjo0xdfqtisU2fuIhzkGesRQAkSiJTugD6k2WqH7W61FvSFuuv6KkhyoSK38L3did0FxFct297k8Mo8dCm4ma9cSvs9y8aSYHjdycjQx4L44lELolYjXQFISOZl06ZieJAxO42hKOxLan6W8d3i1Ff+wh9t4dCyDMq6NnmfGFv3g/Z8OwTzL7cDQfs1ocu2ungUReWphKQgJfMDQMw8dYX8urxLVCVYTxnHcWle4laKKJoymu9b+ZXvLdWrtr/WcRf5B02+l1X00BjdHBm3xRRaO+7ePY4U0Ghzz6O3BkSoiXYKi7geSLEBsJ0imOksy7kWKZmyGKflZba3JmoPF0e9h5CI6bXwRGChoZX86iZK/uETKejOwVv3Jn9a9jtXUmwJgdfal5YoQsqTxvRZqKvafKKXHazzBibl0PoEvrLdu3m3UdX7hwDJwGyFCcxP6rTSJCLWGQYjw8NYSKTG/sSOrnprXxotNijidTOBr6JQqQWyR1ElzKnzJKlqAjkdoI8jPNWN/jd3UaXJMbnc8xEI/ZmOjGeMNb+HC1oTVnjNwhWWezrgwqatfRFd5fxgU08ow0JakWPXhtthTA5aZmL+WlGm1Nvr2WpoacX5xWPvGVn1tfxXJH9KkC/mXqEuAicBGsl3a1aYXx2JbXaSLeIra6NGIRcIcGhO4y0x5yCa2OSwBQ\u003d\u003d", "expiration": 1444400 } }

flashsnake-so commented 9 years ago

I tried to use POSTMAN to test. But I saw an error.