From b54f33d0db44ea2cfb328bf5a12b717416ba3090 Mon Sep 17 00:00:00 2001 From: William Kim Date: Mon, 19 Aug 2013 14:15:53 -0400 Subject: [PATCH] fixed json elements of "claims" and "userinfo" being processed out of order. --- .../org/mitre/openid/connect/view/UserInfoView.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/view/UserInfoView.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/view/UserInfoView.java index 6768d3835..2c2ab5629 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/view/UserInfoView.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/view/UserInfoView.java @@ -208,20 +208,20 @@ public class UserInfoView extends AbstractView { JsonObject obj = toJson(ui, scope); //Process list of requested claims out of the request object - JsonElement userInfo = requestObj.get("userinfo"); - if (userInfo == null || !userInfo.isJsonObject()) { + JsonElement claims = requestObj.get("claims"); + if (claims == null || !claims.isJsonObject()) { return obj; } - JsonElement claims = userInfo.getAsJsonObject().get("claims"); - if (claims == null || !claims.isJsonObject()) { + JsonElement userinfo = claims.getAsJsonObject().get("userinfo"); + if (userinfo == null || !userinfo.isJsonObject()) { return obj; } // TODO: this method is likely to be fragile if the data model changes at all //For each claim found, add it if not already present - for (Entry i : claims.getAsJsonObject().entrySet()) { + for (Entry i : userinfo.getAsJsonObject().entrySet()) { String claimName = i.getKey(); if (!obj.has(claimName)) { String value = "";