Issue with Client_Credential using OAuth2

Not applicable

Hi,

I am trying to use the following url to generate a access token with the following uRL:

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" \ https://XXXXXX-eval-test.apigee.net/oauth/client_credential/accesstoken?grant_type=client_credential... \ -d 'client_id=19TGrhCeCCE6oT18Wz5YoJnFTzUDrfyl &client_secret=u0r1c5vvdlCqTfvA'

but getting the below error:

{"ErrorCode" : "invalid_client", "Error" :"Client identifier is required"}'client_secret' is not recognized as an internal or external command, operable program or batch file.

Regards

Ramesh

0 6 679
6 REPLIES 6

Hey, please check your curl cmd. There is a whitespace before &client_secret

Not applicable

Hi,

We have tried removing the white space as well but with the same error.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" https://XXXXX-eval-test.apigee.net/oauth/client_credential/accesstoken?grant_type=client_credentials -d 'client_id=19TGrhCeCCE6oT18Wz5YoJnFTzUDrfyl&client_secret=u0r1c5vvdlCqTfvA'

Please mention which document/link you are following.

Well, nothing is wrong with the docs. If you followed all steps, then the curl should work.

If you are trying to call the curl in windows machine, try using double quotes instead of single quotes.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" "https://xxxxxxxxxxxxx-eval-test.apigee.net/oauth/client_credential/accesstoken?grant_type=client_credentials" -d "client_id=xxxxxxxxxxxxxxx&client_secret=xxxxxxxxxxxxxxxxxxx"