From b9da10d1761416b1cfce71574853469c512dd552 Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Tue, 10 Sep 2013 11:39:00 -0400 Subject: [PATCH] look up by username instead of subject --- .../org/mitre/openid/connect/web/UserInfoInterceptor.java | 2 +- .../java/org/mitre/openid/connect/web/UserInfoEndpoint.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/web/UserInfoInterceptor.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/web/UserInfoInterceptor.java index 1aba43155..8007538f1 100644 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/web/UserInfoInterceptor.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/web/UserInfoInterceptor.java @@ -88,7 +88,7 @@ public class UserInfoInterceptor extends HandlerInterceptorAdapter { if (p != null && p.getName() != null) { // don't bother checking if we don't have a principal // try to look up a user based on the principal's name - UserInfo user = userInfoService.getBySubject(p.getName()); + UserInfo user = userInfoService.getByUsername(p.getName()); // if we have one, inject it so views can use it if (user != null) { diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java index 816b5d031..db4c7393b 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java @@ -61,11 +61,11 @@ public class UserInfoEndpoint { return "httpCodeView"; } - String userId = p.getName(); - UserInfo userInfo = userInfoService.getBySubject(userId); + String username = p.getName(); + UserInfo userInfo = userInfoService.getByUsername(username); if (userInfo == null) { - logger.error("getInfo failed; user not found: " + userId); + logger.error("getInfo failed; user not found: " + username); model.addAttribute("code", HttpStatus.NOT_FOUND); return "httpCodeView"; }