Not Able to generate OAuth 2.0 Access Token in APIGee -


i new apigee. in project using oauth 2.0 authentication.but not able generate access token. have created required policies, still getting same error time.

this command using generate access token.

i using postman generate access token.

https://<myorgname>test.apigee.net/<myproxyname>/client_credential/accesstoken?grant_type=client_credentials&client_id=<myclient_id>&client_secret=<myclient_secret>’ 

i have tried curl

https://<myorgname>test.apigee.net/<myproxyname>/client_credential/accesstoken?grant_type=client_credentials -x post -d 'client_id=<myclient_id>&client_secret=<myclient_secret>’ 

both of them give same error

{ "fault": { "faultstring": "classification failed host orgname-test.apigee.net", "detail": { "code": "classification_failed" } } }

please help. in advance.

"classification failed" means url not resolving endpoint. there can several reasons this:

  1. you sending in wrong url. url need send in hostname + basepath + pathsuffix. when create proxy in apigee, default basepath /v1/proxyname. make sure /v1 isn't missing. can use trace see hostname + basepath supposed be.
  2. you calling https, proxy isn't set it. make sure secure virtual host referenced in proxyendpoint.
  3. your http verb may incorrect. need use post oauth token. make sure verb matches implementation. if don't provide verb using curl, defaults get.
  4. probably not cause of error, oauth parameters sent in via x-www-form-urlencoded payload, not via command line. also, client id , secret passed in via basic auth. apigee expects these locations default. see oauth 2.0 spec , apigee's docs details.

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -