Open In App

How to add Bearer Token authentication in Postman ?

Postman is a crucial platform for developers, aiding in API testing, creation, and modification. APIs support various website features, such as user registration and login. For secure actions like changing passwords, Bearer Token Authentication is used. Upon login, the server issues a token, acting as proof of authentication. To access protected features, users send this token with their requests, validating their logged-in status through Bearer Token Authentication.

We will discuss two ways to add Bearer token in Postman:



What is Bearer Token authentication?



Now after login, we need to change the password. Now for changing password, we designed our API such that it takes a new password and changes the the previous password with the new password.
But we need to prove that we are already logged In. So for that, we will send Bearer Token with the request of changing password and we will send that token as a Bearer Token which we got on login .

In Authorization Section:

Steps to be followed to send bearer token along with new password-

Output:

In Header Section:

Bearer Token is sent from front end in the header of the request. In the request, we put Bearer Token as a key-value pair, where “Authorization” will be the key and the “Bearer” Keyword followed by Bearer Token after a space as value.

Steps to be followed to send bearer token along with new password-

Output:

Conclusion:

Hence the purpose of Bearer Token authentication in Postman is to verify legitmitacy of the request. It helps in reducing the risk of unauthorized access and dangerous security breaches. It also increase developers efficiency during the development and testing phase because bearer token authentication works in the same way as the authentication in real world application works.

Article Tags :