Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get google auth token from authorization code?

i tried to get the auth token as below:

https://accounts.google.com/o/oauth2/token?client_id=xxxxxxxxx&client_secret=xxxxxxxxxxx&grant_type=authorization_code&code=xxxxxxxxxx&redirect_uri=https://bigquery.cloud.google.com/dataset/projectid:datasetid

Though i already specified the grant_type parameter but still i am getting the below error:

 { "error" : "invalid_request", "error_description" : "Required parameter is missing: grant_type" }

What is the mistake i am doing here?

like image 976
hmims Avatar asked Apr 07 '26 12:04

hmims


1 Answers

You need to use HTTP POST and put the values in POST parameters rather than providing them as query parameters in an HTTP GET request.

like image 168
Hans Z. Avatar answered Apr 09 '26 07:04

Hans Z.