Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Pass Username and Password using POSTMAN - Rest Client?

Tags:

postman

I am a new bee in using POSTMAN - Rest Client - Chrome API

I want to use the Basic Auth which is available in POSTMAN.

I am trying to login into my Google account at url - "https://www.gmail.com".

I provided my Username & Password in the Basic Auth and I had tried GET and POST.

I got a Status 200 OK which loads me the home page but it is not logged in.

I know that i need to change the url, but i am not able to find the correct one which to use?

It would be helpful if @examples are provided for the Different Types of Auth Provided as well.

like image 657
09Q71AO534 Avatar asked Dec 19 '14 05:12

09Q71AO534


2 Answers

The link you have provided is deprecated. I don't know if the Gmail API allowed Basic Auth at the time you asked the question, but right now it needs OAuth 2.0, as indicated in the opening lines here.

The correct url is https://accounts.google.com/o/oauth2/auth, and this link explains how to supply the parameters.

like image 198
Ray Avatar answered Oct 31 '22 20:10

Ray


If I remember correctly, Google stopped allowing http clients(like Postman) accessing its APIs through Basic Auth one year back or more. Now, Google allowing its APIs to be accessed using OAuth 2.0.

For accessing Google APIs, you need to setup an OAuth Application, here When you create this OAuth Application, Google will generate ClientId and ClientSecret.

With these clientId and clientSecret, you need to generate Access and Refresh Tokens and eventually, you will use these tokens to access Google APIs. Read more about Google OAuth 2.0 and you will get more information about accessing APIs.

like image 1
Azim Avatar answered Oct 31 '22 22:10

Azim