protected boolean shouldRenewAuthentication ( final WSFederationRequest fedRequest , final HttpServletRequest request ) { if ( StringUtils . isBlank ( fedRequest . getWfresh ( ) ) || NumberUtils . isCreatable ( fedRequest . getWfresh ( ) ) ) { return false ; } val ttl = Long . parseLong ( fedRequest . getWfresh ( ) . trim ( ) ) ; if ( ttl == 0 ) { return false ; } val idpToken = getSecurityTokenFromRequest ( request ) ; if ( idpToken == null ) { return true ; } val ttlMs = TimeUnit . MINUTES . toMillis ( ttl ) ; if ( ttlMs > 0 ) { val createdDate = idpToken . getCreated ( ) ; if ( createdDate != null ) { val expiryDate = new Date ( ) ; expiryDate . setTime ( createdDate . toEpochMilli ( ) + ttlMs ) ; return expiryDate . before ( new Date ( ) ) ; } } return false ; }
Is authentication required?