diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/ApprovedSite.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/ApprovedSite.java index ec7812231..cbf19b2c9 100644 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/ApprovedSite.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/ApprovedSite.java @@ -217,5 +217,23 @@ public class ApprovedSite { public void setWhitelistedSite(WhitelistedSite whitelistedSite) { this.whitelistedSite = whitelistedSite; } + + /** + * Has this approval expired? + * @return + */ + @Transient + public boolean isExpired() { + if (getTimeoutDate() != null) { + Date now = new Date(); + if (now.after(getTimeoutDate())) { + return true; + } else { + return false; + } + } else { + return false; + } + } }