stormpath-sdk-java
stormpath-sdk-java copied to clipboard
Fix intermittent TCK IT ( CookieIT.cookieExpirationMatchesTokenTtl) failure for the spring-security-webmvc integration
CookieIT.cookieExpirationMatchesTokelTtl intermittently fails when checking the accessTokenCookie.expiryDate.
Sample of failure:
com.stormpath.tck.authentication.CookieIT.(com.stormpath.tck.authentication.CookieIT)
Run 1: CookieIT.cookieExpirationMatchesTokenTtl:130 expected [1481015010000] but found [1481015009000]
if (accessTokenCookie.expiryDate) {
assertEquals accessTokenCookie.expiryDate.time, accessTokenTtl
} else {
assertTrue accessTokenCookie.maxAge * 1000L + now - accessTokenTtl < 2000
}
The first part for checking this issue was to discover why the "Expires" was being set in the cookie instead of the max-age, the reason is that spring-security-webmvc integration runs in Tomcat7.