22
Views
2
Comments
Solved
[JWT] Why the JWT token expiry detected only after 5 minutes?
jwt
Service icon
Forge asset by João Almeida
Application Type
Service
Service Studio Version
11.55.6 (Build 63936)
Platform Version
11.32.0 (Build 44177)

Dear all,

Can you please check this challenge using the forge component in which the time expiry doesn't detected unless 5 minutes has passed and not directly. I even tested in the demo screen of the forge and I'm facing same issue:




2021-10-09 07-57-44
Stefan Weber
 
MVP
Solution

Hi, this behaviour is by default and called ClockSkew. You can read more about here https://learn.microsoft.com/en-us/dotnet/api/microsoft.identitymodel.tokens.tokenvalidationparameters.clockskew

ClockSkew is set to 5 minutes by default. In code you can set this setting, but it can lead to unexpected behaviours as time between issue and verifier may slightly differ.

2025-01-21 04-09-22
Mukesh Kumar

Hi Redha,

I noticed that the JWT token expiry is detected only after 5 minutes in OutSystems. This delay could be due to a few common causes:Server Time Sync Issue: Ensure the server time is synchronized with an NTP server.JWT Validation Leeway: Manually validate the exp claim before processing the token.Token Caching: Disable caching or reduce cache duration in Site Properties to ensure real-time validation.API Gateway Delay: Ensure the API gateway enforces real-time token validation.To resolve this, I recommend validating the exp claim before processing, clearing or reducing cache durations, and using server-side validation via C# or JavaScript.

Best regards,
Mukesh Kumar S.

 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.