API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

Cannot see the cached token in DataPower API Document Status

  • 1.  Cannot see the cached token in DataPower API Document Status

    Posted yesterday
    Edited by Kumar . yesterday

    Dears,

    I have to cache the token to not call the client token service within expiration time. For this I have configured invoke  as below:

    - invoke:           
              version: 2.3.0         
              title: invoke           
              backend-type: detect           
      header-control:             
        type: blocklist             
    values: []           
      parameter-control:             
        type: allowlist             
    values: []           
      http-version: HTTP/1.1           
      timeout: 60           
      verb: keep           
      chunked-uploads: true           
      persistent-connection: true           
      cache-response: time-to-live           
      cache-ttl: 43200           
      stop-on-error: []           
      websocket-upgrade: false           
      target-url: >- https://test          
      output: tokenRes           
      cache-key: cacheToken           
      description: ''           
      graphql-send-type: detect

    I could be able to read the token from "tokenRes" and send it as a bearer to the actual backend that is configured in the second invoke of the same assembly flow. But every time it's giving me the new token as I can't see the cached token in DataPower. 
    This is a client credential and I took below link as a reference to configure the  set-variable:
    https://community.ibm.com/community/user/discussion/how-does-the-cache-work-in-invoke-policy


    Kindly help me with your inputs.



    ------------------------------
    Kumar
    ------------------------------