fixed token expiration parsing

pull/516/head
Justin Richer 2013-09-06 14:44:01 -04:00
parent 94ddc77668
commit 6851224e42
1 changed files with 6 additions and 4 deletions

View File

@ -52,10 +52,12 @@ public class OAuth2AccessTokenImpl implements OAuth2AccessToken {
}
DateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
try {
expireDate = dateFormater.parse(token.get("expires_at").getAsString());
} catch (ParseException ex) {
Logger.getLogger(IntrospectingTokenService.class.getName()).log(Level.SEVERE, null, ex);
if (token.get("exp") != null) {
try {
expireDate = dateFormater.parse(token.get("exp").getAsString());
} catch (ParseException ex) {
Logger.getLogger(IntrospectingTokenService.class.getName()).log(Level.SEVERE, null, ex);
}
}
}