Twitter Oauth Authentication for API Testing Using Rest Assured

Twitter Oauth Authentication for API Testing Using Rest Assured

In this session we would be looking into how to automate one of the most complex and tricky API i.e Twitter API.

As we know for accessing any APIs we first need to provide some sort of authorization so that we can access those API over their server.

Twitter API basically uses Oauth 1.0a and Oauth2 Authentication.

All this information we could easily find by reading twitter official documentation of these API on this link.

To know more about Oauth authentication please click on this link.

Twitter API Provide Oauth in the form of Consumer Key,Consumer Secret,Token and Token Secret which we need to generate for our testing purpose.

Pre-requisite for Automating Twitter API is that we should have active working Twitter account.

Please login into twitter website and create new account if you don’t have. Otherwise we are ready to go.

Now below steps we need to follow to create Consumer Key,Consumer Secret,Token and Token Secret 

1)  Login into and enter your twitter used id and password.

2)  Click on Create an App Option

3)  Fill out the mandatory information. Please Note you can provide any website and Call back URL.

4)  Fill out all the Remaining Mandatory fields and click on Create.

5)  Now Click on Keys and Tokens where we would be able to see     consumer key and Consumer Secret Token.

6)  Click on Create Option under Access Token & access Token Secret to generate token & token secret.

Note down all this Keys carefully with you for all future testing.

Please make sure not to share this access token with anyone as it would be specific only for your account.

Don’t try to use even mine I am going to delete it after using this token :)

If all Steps are done we are now Ready to Automate few sample twitter APIs.For that Refer to my next blog.




My Name is Ankur Jain and I am currently working as Automation Test Architect.I am ISTQB Certified Test Manager,Certified UI Path RPA Developer as well as Certified Scrum Master with total 12 years of working experience with lot of big banking clients around the globe.I love to Design Automation Testing Frameworks with Selenium,Appium,Protractor,Cucumber,Rest-Assured, Katalon Studio and currently exploring lot in Dev-OPS as well. I am currently staying in Mumbai, Maharashtra. Please Connect with me through Contact Us page of this website.

Previous Post
Next Post
April 27, 2019 at 12:23 PM

When we expect new blog:-)

April 28, 2019 at 9:56 AM

Subscribe your email for the new information on this blog :)