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 060583e20..63d3030c1 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 @@ -19,13 +19,22 @@
-

Approve New Site

+

Approval Required for + + + + + + + + +

-
+
<%-- TODO: wire up to stats engine and customize display of this block --%> @@ -33,8 +42,9 @@

Caution:

- This client was dynamically registered and has very few other - users on this system. + This software was dynamically registered and has been used by + + users.
@@ -47,30 +57,40 @@ - Do you authorize - " - - - - - - - " - to sign you into their site using your identity? - +
+ ${client.clientDescription} +
+ +
+
    + +
  • Home page: "> + +
-

-

-

- - Redirect URI: - + + +
+

+ Warning: +

+ This client does not have any redirect URIs registered and could be using a + malicious URI. You will be redirected to the following page if you click Approve: + +
+
+ + + You will be redirected to the following page + if you click Approve: + + +
@@ -84,6 +104,16 @@
Access to: + +
+

+ Warning: +

+ This client does not have any scopes registered and is therefore allowed to + request any scopes available on the system. Proceed with caution. +
+
+
+

+ Do you authorize + " + + + + + + + "? +

@@ -170,6 +211,20 @@ $(document).ready(function() { $('.claim-tooltip').popover(); + + $('#toggleMoreInformation').on('click', function(event) { + event.preventDefault(); + if ($('#moreInformation').is(':visible')) { + // hide it + $('#moreInformation').hide('fast'); + $('#toggleMoreInformation i').attr('class', 'icon-chevron-right'); + } else { + // show it + $('#moreInformation').show('fast'); + $('#toggleMoreInformation i').attr('class', 'icon-chevron-down'); + } + }); + }); //--> 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 fc8d8c9e9..a06f62e49 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 @@ -26,11 +26,13 @@ import java.util.List; import java.util.Map; import java.util.Set; +import org.mitre.oauth2.model.ClientDetailsEntity; import org.mitre.oauth2.model.SystemScope; import org.mitre.oauth2.service.ClientDetailsEntityService; import org.mitre.oauth2.service.SystemScopeService; import org.mitre.openid.connect.model.UserInfo; import org.mitre.openid.connect.service.ScopeClaimTranslationService; +import org.mitre.openid.connect.service.StatsService; import org.mitre.openid.connect.service.UserInfoService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,7 +41,6 @@ import org.springframework.http.HttpStatus; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.oauth2.common.exceptions.OAuth2Exception; import org.springframework.security.oauth2.provider.AuthorizationRequest; -import org.springframework.security.oauth2.provider.ClientDetails; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; @@ -47,10 +48,6 @@ import org.springframework.web.bind.annotation.SessionAttributes; import com.google.common.base.Splitter; import com.google.common.base.Strings; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; -import com.google.common.collect.Multimaps; import com.google.common.collect.Sets; import com.google.gson.JsonObject; @@ -74,6 +71,9 @@ public class OAuthConfirmationController { @Autowired private UserInfoService userInfoService; + @Autowired + private StatsService statsService; + private static Logger logger = LoggerFactory.getLogger(OAuthConfirmationController.class); public OAuthConfirmationController() { @@ -102,7 +102,7 @@ public class OAuthConfirmationController { //AuthorizationRequest clientAuth = (AuthorizationRequest) model.remove("authorizationRequest"); - ClientDetails client = null; + ClientDetailsEntity client = null; try { client = clientService.loadClientByClientId(clientAuth.getClientId()); @@ -129,6 +129,8 @@ public class OAuthConfirmationController { model.put("redirect_uri", redirect_uri); + + // pre-process the scopes Set scopes = scopeService.fromStrings(clientAuth.getScope()); Set sortedScopes = new LinkedHashSet(scopes.size()); @@ -167,6 +169,11 @@ public class OAuthConfirmationController { model.put("claims", claimsForScopes); + // client stats + Integer count = statsService.countForClientId(client.getId()); + model.put("count", count); + + return "approve"; }