Layer7 API Management

 View Only
  • 1.  Re: JWT iat and exp validation

    Posted Sep 30, 2019 03:14 PM
    Hello All,

    Currently we are getting iat in seconds from okta. Trying to validate the iat with current gateway date. Could you help me how to convert the Example:1569821631 to 09/30/2019 and compare with current gate ${gateway.time.MM/dd/yyyy}. 

    For Expiration exp I'm currently comparing ${gateway.time.seconds}. Is there any option to perform 
    Validate Expiration claim (exp) against current date + n? minute clock skew

    Regards,
    Prem. 


  • 2.  RE: Re: JWT iat and exp validation

    Broadcom Employee
    Posted Sep 30, 2019 10:01 PM
    Dear Prem,
    You can use set context variable to convert the timestamp, for example,
    timestamp
    Then when you access ${timestamp}, you will get the value as "2019-09-30T05:33:51.000Z"

    Regards,
    Mark



  • 3.  RE: Re: JWT iat and exp validation

    Posted Oct 02, 2019 12:39 PM
    Thanks Mark!

    That works. 

    Regards,
    Prem,


  • 4.  RE: Re: JWT iat and exp validation

    Posted Oct 02, 2019 12:40 PM
    Hi Mark,

    Is there any option to perform below validation
    For Expiration exp I'm currently comparing ${gateway.time.seconds}.
    Validate Expiration claim (exp) against current date + n? minute clock skew

    Regards,
    Prem. 



  • 5.  RE: Re: JWT iat and exp validation
    Best Answer

    Posted Oct 03, 2019 07:52 AM
    ​Prem,

    In the JWT generation we define the exp value as the result of curr_time + n (seconds), through "set context variable" below. In the final of this process you will have the variable expirationTime with calculated value. See image below
    exp

    I hope to help,
    Best Regards,
    Porcel


  • 6.  RE: Re: JWT iat and exp validation

    Posted Oct 16, 2019 03:11 PM
    Thanks Porcel!