diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/views/approve.jsp b/openid-connect-server-webapp/src/main/webapp/WEB-INF/views/approve.jsp index 139534ea7..04c36f34f 100644 --- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/views/approve.jsp +++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/views/approve.jsp @@ -4,7 +4,7 @@ <%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="o" tagdir="/WEB-INF/tags"%> -<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
@@ -37,16 +37,24 @@
- <%-- TODO: wire up to stats engine and customize display of this block --%> -
"> -

- Caution: -

- This software was dynamically registered and it has been approved - - time previously. -
+ + + +

This client was dynamically registered.

+
+ + +
"> +

+ Caution: +

+ This software was dynamically registered and it has been approved + + time previously. +
+
+
diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthConfirmationController.java b/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthConfirmationController.java index a47781d3f..6bf0c6a4c 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthConfirmationController.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthConfirmationController.java @@ -20,6 +20,7 @@ package org.mitre.oauth2.web; import java.security.Principal; +import java.util.Date; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.List; @@ -181,6 +182,16 @@ public class OAuthConfirmationController { model.put("contacts", contacts); } + // if the client is over a week old and has more than one registration, don't give such a big warning + // instead, tag as "Generally Recognized As Safe (gras) + Date lastWeek = new Date(System.currentTimeMillis() + (60 * 60 * 24 * 7 * 1000)); + //Date lastWeek = new Date(System.currentTimeMillis() - (60 * 60 * 24 * 7 * 1000)); + if (count > 1 && client.getCreatedAt() != null && client.getCreatedAt().before(lastWeek)) { + model.put("gras", true); + } else { + model.put("gras", false); + } + return "approve"; }