How can i update consumer secret from an API proxy ?,update consumer secret

Not applicable

we are using oauth2 token to allow API access.. this also requires to create proxy endpoint to allow users to update their consumer secret. How can we do that?

Can I access management API to update consumer secret via proxy?

the api user is expected to update their consumer key every 90 days. how can we provide them the API to update their consumer secret to the values they want. (not autogenerated)

Solved Solved
0 3 1,619
1 ACCEPTED SOLUTION

In Apigee Edge, it is not possible to modify the consumer id or consumer secret.

It is possible to create a consumer {id,secret} pair.

It is possible to delete the pair. It is not possible to modify the values.

the api user is expected to update their consumer key every 90 days. how can we provide them the API to update their consumer secret to the values they want. (not autogenerated)

That's not how consumer secrets work in Apigee Edge.

IT IS possible to import a consumer {key,secret} pair, using the Management API. This is not modification of an existing { key,secret } pair, but is importation of a new pair.

You can do it like this:

curl -i -H Content-type:application/json \
  https://api.enterprise.apigee.com/v1/o/{org-name}/developers/{developer_email_or_id}/apps/{app_name}... -X POST -d '{ 
  "consumerKey": "NEW_CONSUMER_KEY", 
  "consumerSecret": "NEW_CONSUMER_SECRET"
}'

After that you will probably want to associate that pair with an API Product. Do that like this:

curl -i -H Content-type:application/json https://api.enterprise.apigee.com/v1/o/{org-name}/developers/{developer_email_or_id}/apps/{app_name}... -X POST -d '{ "apiProducts": ["P1", "P2"]}'

View solution in original post

3 REPLIES 3

In Apigee Edge, it is not possible to modify the consumer id or consumer secret.

It is possible to create a consumer {id,secret} pair.

It is possible to delete the pair. It is not possible to modify the values.

the api user is expected to update their consumer key every 90 days. how can we provide them the API to update their consumer secret to the values they want. (not autogenerated)

That's not how consumer secrets work in Apigee Edge.

IT IS possible to import a consumer {key,secret} pair, using the Management API. This is not modification of an existing { key,secret } pair, but is importation of a new pair.

You can do it like this:

curl -i -H Content-type:application/json \
  https://api.enterprise.apigee.com/v1/o/{org-name}/developers/{developer_email_or_id}/apps/{app_name}... -X POST -d '{ 
  "consumerKey": "NEW_CONSUMER_KEY", 
  "consumerSecret": "NEW_CONSUMER_SECRET"
}'

After that you will probably want to associate that pair with an API Product. Do that like this:

curl -i -H Content-type:application/json https://api.enterprise.apigee.com/v1/o/{org-name}/developers/{developer_email_or_id}/apps/{app_name}... -X POST -d '{ "apiProducts": ["P1", "P2"]}'

Thanks for the reply.

So, in order to update the existing consumer key/secret , the flow will have to be Delete exiting pair --> import new pair --> associate the pair with new consumer key.

Well, There is no need to delete the existing pair .

Also I would not call that "update". As I said, there is no way to update a key pair. What you described is creating a new pair, and deleting an old one. Not the same as update, although it may fit your meaning for "update".