Create and Manage APIs: OAuth 2.0: Client Credentials

Not applicable

Hi,

I'm new to apigee. When I try out OAuth 2.0 implementation as described in docs

(/http://apigee.com/docs/gateway-services/content/secure-calls-your-api-through-oauth-20-client-credentials/)

I'm getting an error while executing curl command for getting the access token.

*Error*: "/{"ErrorCode" : "invalid_client", "Error" :"Client credentials are

required"}'client_secret' is not recognized as an internal or external

command,operable program or batch file./"

Can someone please help me?

Solved Solved
0 4 1,557
1 ACCEPTED SOLUTION

Not applicable

The docs do a fairly good job at explaining oAuth, but if you are a new user, I strongly suggest that you look into our Apigee Learn site. There, you will see a link to the Develop and Manage APIs course. If you don't want to step through all of the series, Step 6 goes into detail as to how to get oAuth 2.0, client credentials working in your API. Following those steps should fix your problem. If not, please let us know.

View solution in original post

4 REPLIES 4

Not applicable

Can you post the curl command that is failing (you can obfuscate the actual org you are using)?

Not applicable

The docs do a fairly good job at explaining oAuth, but if you are a new user, I strongly suggest that you look into our Apigee Learn site. There, you will see a link to the Develop and Manage APIs course. If you don't want to step through all of the series, Step 6 goes into detail as to how to get oAuth 2.0, client credentials working in your API. Following those steps should fix your problem. If not, please let us know.

Not applicable

This error is probably due to the fact that there is a documentation issue in the tutorial. I encountered a similar issue. The tutorial suggests that you make a curl call something like:

curl https://org-test.apigee.net/oauth/client_credenti... -X POST -d 'client_id=BddMRxxF1i07LKEjnPj8MvmdG6rtufHi&client_secret=DttuQAUioxxgpPBV'

Which will give you an error similar to that described. The -d parameter in curl can be entered multiple times and will result in each parameter being concatenated with &. So the correct form to get a token is:

curl https://org-test.apigee.net/oauth/client_cr... -X POST -d client_id=BpmPixxxxxxSymEBivVE8rxHujLW7bBM -d client_secret=9bLxxxxxxe2yKOCP

Not applicable

Thanks Gary and Michael, I forgot to mention that I tried executing this curl stmt on Windows. I tried -d parameter with double quotes and it worked perfectly.