From 93a0492e977ee9948ab71fa59beae9519a43ef08 Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Mon, 8 Jul 2013 14:28:41 -0400 Subject: [PATCH] made optional parameters optional --- .../java/org/mitre/oauth2/web/IntrospectionEndpoint.java | 6 ++++-- .../main/java/org/mitre/oauth2/web/RevocationEndpoint.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/web/IntrospectionEndpoint.java b/openid-connect-server/src/main/java/org/mitre/oauth2/web/IntrospectionEndpoint.java index 76163ddad..5a181d6c5 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/web/IntrospectionEndpoint.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/web/IntrospectionEndpoint.java @@ -61,8 +61,10 @@ public class IntrospectionEndpoint { @PreAuthorize("hasRole('ROLE_CLIENT')") @RequestMapping("/introspect") - public String verify(@RequestParam("token") String tokenValue, @RequestParam("resource_id") String resourceId, @RequestParam("token_type_hint") String tokenType, - Principal p, Model model) { + public String verify(@RequestParam("token") String tokenValue, + @RequestParam(value = "resource_id", required = false) String resourceId, + @RequestParam(value = "token_type_hint", required = false) String tokenType, + Principal p, Model model) { if (Strings.isNullOrEmpty(tokenValue)) { logger.error("Verify failed; token value is null"); diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/web/RevocationEndpoint.java b/openid-connect-server/src/main/java/org/mitre/oauth2/web/RevocationEndpoint.java index 4fbbb5cb6..bf0cf834c 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/web/RevocationEndpoint.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/web/RevocationEndpoint.java @@ -43,7 +43,7 @@ public class RevocationEndpoint { @PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_CLIENT')") @RequestMapping("/revoke") - public String revoke(@RequestParam("token") String tokenValue, @RequestParam("token_type_hint") String tokenType, Principal principal, Model model) { + public String revoke(@RequestParam("token") String tokenValue, @RequestParam(value = "token_type_hint", required = false) String tokenType, Principal principal, Model model) { // This is the token as passed in from OAuth (in case we need it some day) //OAuth2AccessTokenEntity tok = tokenServices.getAccessToken((OAuth2Authentication) principal);