How to generate AWS Signature with Postman

Reading Time: 4 minutes

Hello folks, I hope you are having a productive day in this pandemic of COVID-19. Let’s move on to our next blog in the series of API automation. Most of us are doing automation using the tool Postman. So while performing automation with postman we have to integrate many other tools and APIs with Postman. Similarly to use the AWS APIs we need to create the AWS signature. In this, we will come to know how to generate AWS Signature with Postman. First I will start with the problem statement what and why we need to generate AWS Signature.

What & Why we need to generate AWS Signature- 

Signature Version 4 is the process to add authentication information to AWS requests sent by HTTP. When you send HTTP requests to AWS, you sign the requests so that AWS can identify who sent them. You sign requests with your AWS access key, which consists of an access key ID and secret access key. Basically, we need an AWS signature to access the AWS APIs.  

AWS Signature-

AWS4-HMAC-SHA256 Credential=<AccessKeyId>/20200924/<AWS-region>/dynamodb/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-target, Signature=<Signature>

Now we have to generate the AWS signature.AWS provides full documentation to generate it. You can check that documentation here. But it is very difficult and the time is taken to generate. Also, we have to automate the AWS signature with Postman. All we know, that nothing is simple when someone gets stuck into that. So to make it simpler, the postman provides an easy solution for it. So let’s move to the solution-

How to generate AWS Credentials- 

To generate the AWS credentials for AWS signature , we need to first create the user.So these are steps to create user and AWS credentials.

  • First login into an AWS account.
  • Then click on I AM from the AWS console and add a new user for the postman.
  • Now choose the access for the user like here I want to use DynamoDb API, so here I just add the admin access of dynamo DB.the AWS 
  • After this, you should copy the user Access Key ID &  Secret access key

How to generate AWS Signature with Postman-

Let’s first see the error we get while using AWS API without the AWS signature.

By seeing this you can get to know that we need an authentication token.

So to use the AWS API through Postman, we have to pass the AWS signature. In Postman we can easily create the AWS signature with help of Auth. So these are steps –

  • Go to Postman request and click on Auth.
  • Here in auth select the AWS Signature from the drop down.
  • Paste the AWS Access Key Id and Secret Access Key. Also, click on advanced and add the region and service you have to use.
  • Now hit the request and check the response. The response should be 200 OK.

In this above GIF, you can see the Authorization with AWS signature.

So in this way you can configure your AWS API in postman and automate the APIs. Other than this you can also add the AWS credentials in the environmental or global variable of the postman. You can use it as a variable in the authorization like this.

So this is how we can generate the AWS Signature with the postman and use it as it is to access AWS API in postman. If you have any questions and queries related to AWS API in the postman, you can ask in the comments. I’ll provide the solution asap.

I hope you enjoyed it and it helped you!! stay connected for more future blogs. 

Thank you!!  🙂

References:

  1. https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
  2. https://learning.postman.com/docs/getting-started/introduction/

Written by 

I have around 5 Year of Experience in Software Testing. I am working as API Tester and Performance Testing and Used the tools like Jmeter,Postman, ReadyAPI(SoapUI),LoadUI .I have Knowledge of core concepts of manual and automation both and also have knowledge in basic of Selenium Webdriver.I always ready to adopt any environment and zeal to learn the new tools & technologies