spring-attic / spring-social

Allows you to connect your applications with SaaS providers such as Facebook and Twitter.
http://projects.spring.io/spring-social
Apache License 2.0
619 stars 351 forks source link

Possible overflow during access token processing #105

Open redwerk opened 11 years ago

redwerk commented 11 years ago

We have the problem that Facebook long-lived access token's lifetime is two weeks instead of 60 days. The expiration date doesn't correspond to original received from Facebook after Spring Social saves token to DB repository table. The possible problem is overflow in the Spring Social code

public AccessGrant(String accessToken, String scope, String refreshToken, Integer expiresIn) { this.accessToken = accessToken; this.scope = scope; this.refreshToken = refreshToken; this.expireTime = expiresIn != null ? System.currentTimeMillis() + expiresIn * 1000 : null; }

expiresIn * 1000 will overflow the Integer type.

Please check