How to retrieve secret from store in Apigee X proxy

Can someone please suggest which policy to use for retrieving password from secret store in Apigee X proxy.

In Application Integration, there is a dedicated task to do the same. However, in Apigee X , could not find any relevant policy.

Solved Solved
2 2 78
1 ACCEPTED SOLUTION

Can someone please suggest which policy to use for retrieving password from secret store in Apigee X proxy.

Apigee doesn't store passwords. There IS a "secret" - sometimes called a consumer secret, sometimes called a "client secret" - that Apigee manages, for each credential or "client id" (sometimes called consumer Key). If you want to retrieve THAT at runtime (in an API Proxy, within the scope of handling a request), you can use the VerifyAPIKey policy, or the GetOAuthV2Info policy. Administratively, you can inquire the key with this API call:

 

GET :apigee/v1/organizations/:org/developers/:dev/apps/:app/keys/:key
Authorization: Bearer :token

 

And the response payload for that looks like this:

{
  "apiProducts": [
    {
      "apiproduct": "Product-20230825",
      "status": "approved"
    },
    {
      "apiproduct": "Product-20240220",
      "status": "approved"
    }
  ],
  "consumerKey": "QrIyY2AwFu8mgNKPyd6WJD214h6lDGOsQ06PaG1i",
  "consumerSecret": "hdjifVApmsUv3ZXmeJiRUOXA3KsXW9epAK9ixuSLFee1mDTtDQ8",
  "expiresAt": "-1",
  "issuedAt": "1696452684603",
  "scopes": [
    "courses:read",
    "modules:read"
  ],
  "status": "approved"
}

In Application Integration, there is a dedicated task to do the same. However, in Apigee X , could not find any relevant policy.

I don't know about the dedicated task to retrieve ... passwords or secrets, in Application Integration.

View solution in original post

2 REPLIES 2

Can someone please suggest which policy to use for retrieving password from secret store in Apigee X proxy.

Apigee doesn't store passwords. There IS a "secret" - sometimes called a consumer secret, sometimes called a "client secret" - that Apigee manages, for each credential or "client id" (sometimes called consumer Key). If you want to retrieve THAT at runtime (in an API Proxy, within the scope of handling a request), you can use the VerifyAPIKey policy, or the GetOAuthV2Info policy. Administratively, you can inquire the key with this API call:

 

GET :apigee/v1/organizations/:org/developers/:dev/apps/:app/keys/:key
Authorization: Bearer :token

 

And the response payload for that looks like this:

{
  "apiProducts": [
    {
      "apiproduct": "Product-20230825",
      "status": "approved"
    },
    {
      "apiproduct": "Product-20240220",
      "status": "approved"
    }
  ],
  "consumerKey": "QrIyY2AwFu8mgNKPyd6WJD214h6lDGOsQ06PaG1i",
  "consumerSecret": "hdjifVApmsUv3ZXmeJiRUOXA3KsXW9epAK9ixuSLFee1mDTtDQ8",
  "expiresAt": "-1",
  "issuedAt": "1696452684603",
  "scopes": [
    "courses:read",
    "modules:read"
  ],
  "status": "approved"
}

In Application Integration, there is a dedicated task to do the same. However, in Apigee X , could not find any relevant policy.

I don't know about the dedicated task to retrieve ... passwords or secrets, in Application Integration.

Thanks @dchiesa1  , that helps!