Layer7 API Management

  • 1.  Validate JWT exp parameter

    Posted Jun 10, 2017 08:26 AM

    What is the best way to validate JWT exp parameter (expiration) in CA API Gateway 9.2 ? Do we have a specific assertion?

     

    I would like to check and return a specific error based in expiration info.



  • 2.  Re: Validate JWT exp parameter
    Best Answer

    Posted Oct 06, 2017 06:32 PM

    Hi!

    Extract 'exp' using a JSON Path assertion. Since 'exp' is a 10-digit timestamp use a comparison assertion and compare "${exp}" against "${gateway.time.seconds}". Either 'exp > ...' or 'exp < ...', depending on your comparison. Expired or still valid.