Browse Source

fixed token expiration parsing

pull/650/head
Justin Richer 11 years ago
parent
commit
3524350086
  1. 10
      openid-connect-client/src/main/java/org/mitre/oauth2/introspectingfilter/OAuth2AccessTokenImpl.java

10
openid-connect-client/src/main/java/org/mitre/oauth2/introspectingfilter/OAuth2AccessTokenImpl.java

@ -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);
}
}
}

Loading…
Cancel
Save