How to get google oAuth2.0 access token using curl command?How to send a header using a HTTP request through a curl call?How do I get a YouTube video thumbnail from the YouTube API?How do I POST JSON data with Curl from a terminal/commandline to Test Spring REST?curl php cannot get access token from google. Curl returns nothing400 Bad Request when sending http post request to get token from auth code?authorization google drive curl (language c)Google OAuth token exchange returns invalid_codeGoogle API oAuth2.0 — Consumer is not registeredSpotify API - error retrieving access token during authorization processNot getting Access token using retrofit2 in android client
Terence Tao–type books in other fields?
Inadvertently nuked my disk permission structure - why?
A planet illuminated by a black hole?
How can I create a pattern of parallel lines that are increasing in distance in Photoshop / Illustrator?
Trapped in an ocean Temple in Minecraft?
What do I do when a student working in my lab "ghosts" me?
Binomial analogue of Riemann sum for definite integral
Request for a Latin phrase as motto "God is highest/supreme"
Print sums of all subsets
TSA asking to see cell phone
How can I stop myself from micromanaging other PCs' actions?
Can the 2019 UA Artificer's Returning Weapon and Radiant Weapon infusions stack on the same weapon?
What is the meaning of "you has the wind of me"?
Singapore to Sydney to Canberra: where do we clear customs
Why did Saturn V not head straight to the moon?
Drillers for petroleum strike gusher of blood
What is a Waiting Word™?
Does the Intel 8086 CPU have user mode and kernel mode?
Are there any examples of technologies have been lost over time?
How do I run a game when my PCs have different approaches to combat?
Strange Cron Job takes up 100% of CPU Ubuntu 18 LTS Server
What self-defense weapons are legal in London?
401(k) investment after being fired. Do I own it?
How do professional electronic musicians/sound engineers combat listening fatigue?
How to get google oAuth2.0 access token using curl command?
How to send a header using a HTTP request through a curl call?How do I get a YouTube video thumbnail from the YouTube API?How do I POST JSON data with Curl from a terminal/commandline to Test Spring REST?curl php cannot get access token from google. Curl returns nothing400 Bad Request when sending http post request to get token from auth code?authorization google drive curl (language c)Google OAuth token exchange returns invalid_codeGoogle API oAuth2.0 — Consumer is not registeredSpotify API - error retrieving access token during authorization processNot getting Access token using retrofit2 in android client
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I was experimenting the google's REST apis. Here, I was trying to generate the access token from cURL command to use that in further REST request.
But I was facing the below errors.
I was trying to get the access token tru the below cURL command but i getting below error responses.
curl
--request POST
--data "code=4/GQEg70zaxHAuRhhd6A1RB_6LIxwwBV8ak5xRP-nZIBTjuvt4g3fTWyU&client_id=954040553015-bphgid2596t65i91827omteq778cp7gj.apps.googleusercontent.com&client_secret=Sn3giYFFPMCNteKC--938xsP&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code"
https://accounts.google.com/o/oauth2/token
Response:
"error": "invalid_grant",
"error_description": "Bad Request"
Then I have edited the command as below but it fails.
curl -d client_id=954040553015-bphgid2596t65i91827omteq778cp7gj.apps.googleusercontent.com -d client_secret=Sn3giYFFPMCNteKC--938xsP -d grant_type=authorization_code -d redirect_uri=urn:ietf:wg:oauth:2.0:oob -d code=4/GQEg70zaxHAuRhhd6A1RB_6LIxwwBV8ak5xRP-nZIBTjuvt4g3fTWyU https://oauth2.googleapis.com/token
Response:
"error": "invalid_grant",
"error_description": "Bad Request"
So, based on this link https://gist.github.com/LindaLawton/cff75182aac5fa42930a09f58b63a309#file-googleauthenticationcurl-sh I have changed the grant_type=client_credentials. But again I got the error response.
"error": "unsupported_grant_type",
"error_description": "Invalid grant_type: client_credentials"
So, Please help me to resolve the error.
add a comment |
I was experimenting the google's REST apis. Here, I was trying to generate the access token from cURL command to use that in further REST request.
But I was facing the below errors.
I was trying to get the access token tru the below cURL command but i getting below error responses.
curl
--request POST
--data "code=4/GQEg70zaxHAuRhhd6A1RB_6LIxwwBV8ak5xRP-nZIBTjuvt4g3fTWyU&client_id=954040553015-bphgid2596t65i91827omteq778cp7gj.apps.googleusercontent.com&client_secret=Sn3giYFFPMCNteKC--938xsP&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code"
https://accounts.google.com/o/oauth2/token
Response:
"error": "invalid_grant",
"error_description": "Bad Request"
Then I have edited the command as below but it fails.
curl -d client_id=954040553015-bphgid2596t65i91827omteq778cp7gj.apps.googleusercontent.com -d client_secret=Sn3giYFFPMCNteKC--938xsP -d grant_type=authorization_code -d redirect_uri=urn:ietf:wg:oauth:2.0:oob -d code=4/GQEg70zaxHAuRhhd6A1RB_6LIxwwBV8ak5xRP-nZIBTjuvt4g3fTWyU https://oauth2.googleapis.com/token
Response:
"error": "invalid_grant",
"error_description": "Bad Request"
So, based on this link https://gist.github.com/LindaLawton/cff75182aac5fa42930a09f58b63a309#file-googleauthenticationcurl-sh I have changed the grant_type=client_credentials. But again I got the error response.
"error": "unsupported_grant_type",
"error_description": "Invalid grant_type: client_credentials"
So, Please help me to resolve the error.
Where did you get the value for thecodeparam? Are you sure you have correctly escaped all meta characters? Add-vto your curl and check that what is being sent is what you think is being sent. Go to developers.google.com/oauthplayground and step through the auth flow. Compare what is being sent by the playground with what you are sending.
– pinoyyid
Mar 26 at 19:35
I got the code from the link and copied the code from the webpage and added to the curl command. accounts.google.com/o/oauth2/… I have added -v to curl command, but not helpful.
– KIRUBAKARAN S
Mar 27 at 6:20
paste the output from thecurl -v
– pinoyyid
Mar 27 at 8:43
Hi, please find thecurl -vlog here drive.google.com/open?id=1qE0AUbX2yqNXz6GyQxYNT_OcS1RnQzXd
– KIRUBAKARAN S
Mar 27 at 9:35
add a comment |
I was experimenting the google's REST apis. Here, I was trying to generate the access token from cURL command to use that in further REST request.
But I was facing the below errors.
I was trying to get the access token tru the below cURL command but i getting below error responses.
curl
--request POST
--data "code=4/GQEg70zaxHAuRhhd6A1RB_6LIxwwBV8ak5xRP-nZIBTjuvt4g3fTWyU&client_id=954040553015-bphgid2596t65i91827omteq778cp7gj.apps.googleusercontent.com&client_secret=Sn3giYFFPMCNteKC--938xsP&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code"
https://accounts.google.com/o/oauth2/token
Response:
"error": "invalid_grant",
"error_description": "Bad Request"
Then I have edited the command as below but it fails.
curl -d client_id=954040553015-bphgid2596t65i91827omteq778cp7gj.apps.googleusercontent.com -d client_secret=Sn3giYFFPMCNteKC--938xsP -d grant_type=authorization_code -d redirect_uri=urn:ietf:wg:oauth:2.0:oob -d code=4/GQEg70zaxHAuRhhd6A1RB_6LIxwwBV8ak5xRP-nZIBTjuvt4g3fTWyU https://oauth2.googleapis.com/token
Response:
"error": "invalid_grant",
"error_description": "Bad Request"
So, based on this link https://gist.github.com/LindaLawton/cff75182aac5fa42930a09f58b63a309#file-googleauthenticationcurl-sh I have changed the grant_type=client_credentials. But again I got the error response.
"error": "unsupported_grant_type",
"error_description": "Invalid grant_type: client_credentials"
So, Please help me to resolve the error.
I was experimenting the google's REST apis. Here, I was trying to generate the access token from cURL command to use that in further REST request.
But I was facing the below errors.
I was trying to get the access token tru the below cURL command but i getting below error responses.
curl
--request POST
--data "code=4/GQEg70zaxHAuRhhd6A1RB_6LIxwwBV8ak5xRP-nZIBTjuvt4g3fTWyU&client_id=954040553015-bphgid2596t65i91827omteq778cp7gj.apps.googleusercontent.com&client_secret=Sn3giYFFPMCNteKC--938xsP&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code"
https://accounts.google.com/o/oauth2/token
Response:
"error": "invalid_grant",
"error_description": "Bad Request"
Then I have edited the command as below but it fails.
curl -d client_id=954040553015-bphgid2596t65i91827omteq778cp7gj.apps.googleusercontent.com -d client_secret=Sn3giYFFPMCNteKC--938xsP -d grant_type=authorization_code -d redirect_uri=urn:ietf:wg:oauth:2.0:oob -d code=4/GQEg70zaxHAuRhhd6A1RB_6LIxwwBV8ak5xRP-nZIBTjuvt4g3fTWyU https://oauth2.googleapis.com/token
Response:
"error": "invalid_grant",
"error_description": "Bad Request"
So, based on this link https://gist.github.com/LindaLawton/cff75182aac5fa42930a09f58b63a309#file-googleauthenticationcurl-sh I have changed the grant_type=client_credentials. But again I got the error response.
"error": "unsupported_grant_type",
"error_description": "Invalid grant_type: client_credentials"
So, Please help me to resolve the error.
asked Mar 26 at 17:32
KIRUBAKARAN SKIRUBAKARAN S
287 bronze badges
287 bronze badges
Where did you get the value for thecodeparam? Are you sure you have correctly escaped all meta characters? Add-vto your curl and check that what is being sent is what you think is being sent. Go to developers.google.com/oauthplayground and step through the auth flow. Compare what is being sent by the playground with what you are sending.
– pinoyyid
Mar 26 at 19:35
I got the code from the link and copied the code from the webpage and added to the curl command. accounts.google.com/o/oauth2/… I have added -v to curl command, but not helpful.
– KIRUBAKARAN S
Mar 27 at 6:20
paste the output from thecurl -v
– pinoyyid
Mar 27 at 8:43
Hi, please find thecurl -vlog here drive.google.com/open?id=1qE0AUbX2yqNXz6GyQxYNT_OcS1RnQzXd
– KIRUBAKARAN S
Mar 27 at 9:35
add a comment |
Where did you get the value for thecodeparam? Are you sure you have correctly escaped all meta characters? Add-vto your curl and check that what is being sent is what you think is being sent. Go to developers.google.com/oauthplayground and step through the auth flow. Compare what is being sent by the playground with what you are sending.
– pinoyyid
Mar 26 at 19:35
I got the code from the link and copied the code from the webpage and added to the curl command. accounts.google.com/o/oauth2/… I have added -v to curl command, but not helpful.
– KIRUBAKARAN S
Mar 27 at 6:20
paste the output from thecurl -v
– pinoyyid
Mar 27 at 8:43
Hi, please find thecurl -vlog here drive.google.com/open?id=1qE0AUbX2yqNXz6GyQxYNT_OcS1RnQzXd
– KIRUBAKARAN S
Mar 27 at 9:35
Where did you get the value for the
code param? Are you sure you have correctly escaped all meta characters? Add -v to your curl and check that what is being sent is what you think is being sent. Go to developers.google.com/oauthplayground and step through the auth flow. Compare what is being sent by the playground with what you are sending.– pinoyyid
Mar 26 at 19:35
Where did you get the value for the
code param? Are you sure you have correctly escaped all meta characters? Add -v to your curl and check that what is being sent is what you think is being sent. Go to developers.google.com/oauthplayground and step through the auth flow. Compare what is being sent by the playground with what you are sending.– pinoyyid
Mar 26 at 19:35
I got the code from the link and copied the code from the webpage and added to the curl command. accounts.google.com/o/oauth2/… I have added -v to curl command, but not helpful.
– KIRUBAKARAN S
Mar 27 at 6:20
I got the code from the link and copied the code from the webpage and added to the curl command. accounts.google.com/o/oauth2/… I have added -v to curl command, but not helpful.
– KIRUBAKARAN S
Mar 27 at 6:20
paste the output from the
curl -v– pinoyyid
Mar 27 at 8:43
paste the output from the
curl -v– pinoyyid
Mar 27 at 8:43
Hi, please find the
curl -v log here drive.google.com/open?id=1qE0AUbX2yqNXz6GyQxYNT_OcS1RnQzXd– KIRUBAKARAN S
Mar 27 at 9:35
Hi, please find the
curl -v log here drive.google.com/open?id=1qE0AUbX2yqNXz6GyQxYNT_OcS1RnQzXd– KIRUBAKARAN S
Mar 27 at 9:35
add a comment |
2 Answers
2
active
oldest
votes
So the answer was in the question. "Invalid grant_type: client_credentials" whereas the grant type should be authorization_code
My advice for you was to go to the OAuth playground and compare what it sends with what you are sending. Here is a paste from the playground...
POST /oauth2/v4/token HTTP/1.1
Host: www.googleapis.com
Content-length: 277
content-type: application/x-www-form-urlencoded
user-agent: google-oauth-playground
code=4%2FGgFtOcUM73dTMJNpE7XR7w082MrYH-LCm7zMylg31ESKrwmpyQXnzOM
&redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground
&client_id=407408718192.apps.googleusercontent.com
&client_secret=************
&scope=
&grant_type=authorization_code
add a comment |
don't use urn:ietf:wg:oauth:2.0:oob
nor use https://developers.google.com/oauthplayground
but use http://localhost ...
or any web-server, which rewrites the post-back to a local host-name.
unless processing that post-back, the cURL request by itself is useless.
while this question does not even disclose if this is on-line or behind NAT.
for server to server oAuth2 flow, you need an on-line host & credentials for a service-account.
Actually, I was experimenting through the shell script, so I had no chance to use in google's oAuth playground. Also, I have not configured any web server locally.
– KIRUBAKARAN S
Mar 27 at 14:33
@KIRUBAKARANS without that, you might be out of luck, because the postback will be lost. it works about like this (which also counts for an oAuth2-flow initiated by shell script): oauth.com/oauth2-servers/server-side-apps ...custom local host-names or ports require an on-line web-server, else it will fail to resolve DNS.
– Martin Zeitler
Mar 27 at 14:41
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55363098%2fhow-to-get-google-oauth2-0-access-token-using-curl-command%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
So the answer was in the question. "Invalid grant_type: client_credentials" whereas the grant type should be authorization_code
My advice for you was to go to the OAuth playground and compare what it sends with what you are sending. Here is a paste from the playground...
POST /oauth2/v4/token HTTP/1.1
Host: www.googleapis.com
Content-length: 277
content-type: application/x-www-form-urlencoded
user-agent: google-oauth-playground
code=4%2FGgFtOcUM73dTMJNpE7XR7w082MrYH-LCm7zMylg31ESKrwmpyQXnzOM
&redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground
&client_id=407408718192.apps.googleusercontent.com
&client_secret=************
&scope=
&grant_type=authorization_code
add a comment |
So the answer was in the question. "Invalid grant_type: client_credentials" whereas the grant type should be authorization_code
My advice for you was to go to the OAuth playground and compare what it sends with what you are sending. Here is a paste from the playground...
POST /oauth2/v4/token HTTP/1.1
Host: www.googleapis.com
Content-length: 277
content-type: application/x-www-form-urlencoded
user-agent: google-oauth-playground
code=4%2FGgFtOcUM73dTMJNpE7XR7w082MrYH-LCm7zMylg31ESKrwmpyQXnzOM
&redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground
&client_id=407408718192.apps.googleusercontent.com
&client_secret=************
&scope=
&grant_type=authorization_code
add a comment |
So the answer was in the question. "Invalid grant_type: client_credentials" whereas the grant type should be authorization_code
My advice for you was to go to the OAuth playground and compare what it sends with what you are sending. Here is a paste from the playground...
POST /oauth2/v4/token HTTP/1.1
Host: www.googleapis.com
Content-length: 277
content-type: application/x-www-form-urlencoded
user-agent: google-oauth-playground
code=4%2FGgFtOcUM73dTMJNpE7XR7w082MrYH-LCm7zMylg31ESKrwmpyQXnzOM
&redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground
&client_id=407408718192.apps.googleusercontent.com
&client_secret=************
&scope=
&grant_type=authorization_code
So the answer was in the question. "Invalid grant_type: client_credentials" whereas the grant type should be authorization_code
My advice for you was to go to the OAuth playground and compare what it sends with what you are sending. Here is a paste from the playground...
POST /oauth2/v4/token HTTP/1.1
Host: www.googleapis.com
Content-length: 277
content-type: application/x-www-form-urlencoded
user-agent: google-oauth-playground
code=4%2FGgFtOcUM73dTMJNpE7XR7w082MrYH-LCm7zMylg31ESKrwmpyQXnzOM
&redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground
&client_id=407408718192.apps.googleusercontent.com
&client_secret=************
&scope=
&grant_type=authorization_code
answered Mar 27 at 12:35
pinoyyidpinoyyid
14.6k9 gold badges37 silver badges87 bronze badges
14.6k9 gold badges37 silver badges87 bronze badges
add a comment |
add a comment |
don't use urn:ietf:wg:oauth:2.0:oob
nor use https://developers.google.com/oauthplayground
but use http://localhost ...
or any web-server, which rewrites the post-back to a local host-name.
unless processing that post-back, the cURL request by itself is useless.
while this question does not even disclose if this is on-line or behind NAT.
for server to server oAuth2 flow, you need an on-line host & credentials for a service-account.
Actually, I was experimenting through the shell script, so I had no chance to use in google's oAuth playground. Also, I have not configured any web server locally.
– KIRUBAKARAN S
Mar 27 at 14:33
@KIRUBAKARANS without that, you might be out of luck, because the postback will be lost. it works about like this (which also counts for an oAuth2-flow initiated by shell script): oauth.com/oauth2-servers/server-side-apps ...custom local host-names or ports require an on-line web-server, else it will fail to resolve DNS.
– Martin Zeitler
Mar 27 at 14:41
add a comment |
don't use urn:ietf:wg:oauth:2.0:oob
nor use https://developers.google.com/oauthplayground
but use http://localhost ...
or any web-server, which rewrites the post-back to a local host-name.
unless processing that post-back, the cURL request by itself is useless.
while this question does not even disclose if this is on-line or behind NAT.
for server to server oAuth2 flow, you need an on-line host & credentials for a service-account.
Actually, I was experimenting through the shell script, so I had no chance to use in google's oAuth playground. Also, I have not configured any web server locally.
– KIRUBAKARAN S
Mar 27 at 14:33
@KIRUBAKARANS without that, you might be out of luck, because the postback will be lost. it works about like this (which also counts for an oAuth2-flow initiated by shell script): oauth.com/oauth2-servers/server-side-apps ...custom local host-names or ports require an on-line web-server, else it will fail to resolve DNS.
– Martin Zeitler
Mar 27 at 14:41
add a comment |
don't use urn:ietf:wg:oauth:2.0:oob
nor use https://developers.google.com/oauthplayground
but use http://localhost ...
or any web-server, which rewrites the post-back to a local host-name.
unless processing that post-back, the cURL request by itself is useless.
while this question does not even disclose if this is on-line or behind NAT.
for server to server oAuth2 flow, you need an on-line host & credentials for a service-account.
don't use urn:ietf:wg:oauth:2.0:oob
nor use https://developers.google.com/oauthplayground
but use http://localhost ...
or any web-server, which rewrites the post-back to a local host-name.
unless processing that post-back, the cURL request by itself is useless.
while this question does not even disclose if this is on-line or behind NAT.
for server to server oAuth2 flow, you need an on-line host & credentials for a service-account.
edited Mar 27 at 14:00
answered Mar 27 at 13:53
Martin ZeitlerMartin Zeitler
23.9k5 gold badges51 silver badges88 bronze badges
23.9k5 gold badges51 silver badges88 bronze badges
Actually, I was experimenting through the shell script, so I had no chance to use in google's oAuth playground. Also, I have not configured any web server locally.
– KIRUBAKARAN S
Mar 27 at 14:33
@KIRUBAKARANS without that, you might be out of luck, because the postback will be lost. it works about like this (which also counts for an oAuth2-flow initiated by shell script): oauth.com/oauth2-servers/server-side-apps ...custom local host-names or ports require an on-line web-server, else it will fail to resolve DNS.
– Martin Zeitler
Mar 27 at 14:41
add a comment |
Actually, I was experimenting through the shell script, so I had no chance to use in google's oAuth playground. Also, I have not configured any web server locally.
– KIRUBAKARAN S
Mar 27 at 14:33
@KIRUBAKARANS without that, you might be out of luck, because the postback will be lost. it works about like this (which also counts for an oAuth2-flow initiated by shell script): oauth.com/oauth2-servers/server-side-apps ...custom local host-names or ports require an on-line web-server, else it will fail to resolve DNS.
– Martin Zeitler
Mar 27 at 14:41
Actually, I was experimenting through the shell script, so I had no chance to use in google's oAuth playground. Also, I have not configured any web server locally.
– KIRUBAKARAN S
Mar 27 at 14:33
Actually, I was experimenting through the shell script, so I had no chance to use in google's oAuth playground. Also, I have not configured any web server locally.
– KIRUBAKARAN S
Mar 27 at 14:33
@KIRUBAKARANS without that, you might be out of luck, because the postback will be lost. it works about like this (which also counts for an oAuth2-flow initiated by shell script): oauth.com/oauth2-servers/server-side-apps ...custom local host-names or ports require an on-line web-server, else it will fail to resolve DNS.
– Martin Zeitler
Mar 27 at 14:41
@KIRUBAKARANS without that, you might be out of luck, because the postback will be lost. it works about like this (which also counts for an oAuth2-flow initiated by shell script): oauth.com/oauth2-servers/server-side-apps ...custom local host-names or ports require an on-line web-server, else it will fail to resolve DNS.
– Martin Zeitler
Mar 27 at 14:41
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55363098%2fhow-to-get-google-oauth2-0-access-token-using-curl-command%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Where did you get the value for the
codeparam? Are you sure you have correctly escaped all meta characters? Add-vto your curl and check that what is being sent is what you think is being sent. Go to developers.google.com/oauthplayground and step through the auth flow. Compare what is being sent by the playground with what you are sending.– pinoyyid
Mar 26 at 19:35
I got the code from the link and copied the code from the webpage and added to the curl command. accounts.google.com/o/oauth2/… I have added -v to curl command, but not helpful.
– KIRUBAKARAN S
Mar 27 at 6:20
paste the output from the
curl -v– pinoyyid
Mar 27 at 8:43
Hi, please find the
curl -vlog here drive.google.com/open?id=1qE0AUbX2yqNXz6GyQxYNT_OcS1RnQzXd– KIRUBAKARAN S
Mar 27 at 9:35