Layer7 API Management

  • 1.  Cached Token Age

    Posted Jun 01, 2017 09:03 AM

    Hi All,

    can anyone tell me how do i get to know age of token when saved in Gateway cache.

     

    for Eg : I have generated a token and saved in gateway cache with expiry time of 1000 sec, now when i invoke the API i will get the token from cache. Now here i want to know what is the time left before token expire gets expired.

     

    I need assertion for getting this details.

     

    Thanks,



  • 2.  Re: Cached Token Age
    Best Answer

    Broadcom Employee
    Posted Jun 07, 2017 04:44 PM

    Hello,

     

    While there is no set assertion for this information, it does exist in the database for the token itself.

     

    You could use a JDBC Query to acheive this information with a SELECT command to the OTK DB.

     

    Ex: select created, expiration from oauth_token where token like 'b4b50907-6823-4da3-9943-a2dee54d8da2';

     

    --to find when it was created and when expires (in epoch time), and then reference that with current time to see how long is left on the cache etc.