Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.1k views
in Technique[技术] by (71.8m points)

c# - how to get access token using grant type client credentials or password for google drive in postman

We are unable to get access token of google drive using grant type client credentials or grant type password in postman. Please help me with the solution.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
{
  "error": "unsupported_grant_type",
  "error_description": "Invalid grant_type: password"
}  

this is the response from google authorization api , its not supported only authporization code is supported

Steps:

  1. https://console.developers.google.com/ Goto url and create an API. (by clicking credentials>create credentials)

  2. https://console.developers.google.com/apis/api/drive.googleapis.com/overview Goto url, click credentials> create new 0auth0.2 ( select applicaiton type as Web application)

  3. While creating 0auth0.2 scroll down and set Authorized redirect URIs as https://localhost

enter image description here

  1. CLick the download as json and then save the auth

  2. Open postman and set authorization as 0auth2.0 from authorization header:

  3. Generate new token by filling the content as per the downloaded json ( open the json and fill postman as in json)

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...