How to Handle Authentication in Rest Assured | Basic,Digest,Form OAuth1 OAuth2 (LIVE Demo) | Day18

Published: 12 August 2020
on channel: The Testing Academy
38,248
269

In this video, We are going to learn How to handle the Authentication in RestAssured, in the demo part I have covered the Authentication like Basic, Digest, Form and OAuth1, OAuth2 step by step.

✅ Must Read - https://scrolltest.com/auth
For OAuth Token - https://api.imgur.com/oauth2/addclient

🚀 All 30 Days Task - https://scrolltest.com/30days/restass...
📌 Join 30 Days Challenge Updates - https://scrolltest.com/tta
🎓 Free Automation MasterClass - https://thetestingacademy.com
📚 REST API testing with Python - https://masterapitesting.com

✅ What is Authentication?

Authentication is a process of presenting your credentials like username, password or another secret key to the system and the system to validate your credentials or you.

In the API terms Authentication is used to protect the content over web mean only a valid user with valid credentials can access that API endpoint.

These credentials tell the system about who you are. Which enables the system to ensures and confirms a user’s identity

✅What is Basic Authentication

Basic access authentication is a method for an HTTP user agent (e.g. a web browser) to provide a username and password when making a request. In the example, we will use the postman internal URL to create Basic Auth example –[https://postman-echo.com/basic-auth](https://postman-echo.com/basic-auth)

✅What is Digest Authentication

Digest Auth is another authentication method used by most of the websites. In the Digest access authentication is one of the agreed-upon methods a web server can use to negotiate credentials, such as username or password, with a user’s web browser. In the Digest Auth. method username and password are sent over the web after applying some hash functions, Therefore which makes it more secure over network.

e.g HA1 = MD5(username:realm:password)HA2 = MD5(method:digestURI)response = MD5(HA1:nonce:HA2)

✅OAuth 1.0 & 2.0:-

They are the way for Internet users to grant websites or applications access to their information on other websites but without giving them the passwords. When you perform the OAuth most of the time you have to get the Access token from the website after submitting the details like consumer key etc. So to make OAuth 1.0 request you need to pass the Consumer key, Secret and Access Token, Token Secret.

Source
https://scrolltest.com/2018/11/22/how...
https://swagger.io/docs/specification...

✅ What is REST Assured?
REST Assured is a Java library that provides a domain-specific language (DSL) for writing powerful, maintainable tests for RESTful APIs. ... I'll be using real-world code examples you can copy, run, and reuse directly in your own test automation effort

🌍 Test Automation -
https://bit.ly/learnautomation2020

💌 API Testing -
https://www.learnapitesting.com

🎙 Cypress Tutorial with LIVE Projects -
https://cypresstutorial.com

📝 REST API testing with Python -
https://masterapitesting.com

#restassured #restassuredtutorial #apitesting #api #automationtesting #manualtesting #testautomation #thetestingacademy #scrolltest