@Test public void shouldResolveClaimsRequest_userInfo_unrecognized_value() throws ClaimsRequestSyntaxException { String claims = "{\"userinfo\": {\"name\": {\"essential\": true}, \"family_name\": \"unrecognized\"}}"; ClaimsRequest claimsRequest = claimsRequestResolver.resolve(claims); Assert.assertNull(claimsRequest.getIdTokenClaims()); Assert.assertNotNull(claimsRequest.getUserInfoClaims()); Assert.assertTrue(claimsRequest.getUserInfoClaims().size() == 1); Assert.assertTrue(claimsRequest.getUserInfoClaims().containsKey("name")); Assert.assertFalse(claimsRequest.getUserInfoClaims().containsKey("family_name")); }
public ClaimsRequest resolve(String claims) throws ClaimsRequestSyntaxException { try { JsonObject claimsValue = new JsonObject(claims); ClaimsRequest claimsRequest = new ClaimsRequest(); claimsRequest.setUserInfoClaims(resolveClaimsRequest(claimsValue, ClaimsRequest.USERINFO)); claimsRequest.setIdTokenClaims(resolveClaimsRequest(claimsValue, ClaimsRequest.ID_TOKEN)); return claimsRequest; } catch (Exception e) { throw new ClaimsRequestSyntaxException(e); } }
ClaimsRequestResolver { public ClaimsRequest resolve(String claims) throws ClaimsRequestSyntaxException { try { JsonObject claimsValue = new JsonObject(claims); ClaimsRequest claimsRequest = new ClaimsRequest(); claimsRequest.setUserInfoClaims(resolveClaimsRequest(claimsValue, ClaimsRequest.USERINFO)); claimsRequest.setIdTokenClaims(resolveClaimsRequest(claimsValue, ClaimsRequest.ID_TOKEN)); return claimsRequest; } catch (Exception e) { throw new ClaimsRequestSyntaxException(e); } } }
ClaimsRequestResolver { public ClaimsRequest resolve(String claims) throws ClaimsRequestSyntaxException { try { JsonObject claimsValue = new JsonObject(claims); ClaimsRequest claimsRequest = new ClaimsRequest(); claimsRequest.setUserInfoClaims(resolveClaimsRequest(claimsValue, ClaimsRequest.USERINFO)); claimsRequest.setIdTokenClaims(resolveClaimsRequest(claimsValue, ClaimsRequest.ID_TOKEN)); return claimsRequest; } catch (Exception e) { throw new ClaimsRequestSyntaxException(e); } }  }
ClaimsRequestResolver { public ClaimsRequest resolve(String claims) throws ClaimsRequestSyntaxException { try { JsonObject claimsValue = new JsonObject(claims); ClaimsRequest claimsRequest = new ClaimsRequest(); claimsRequest.setUserInfoClaims(resolveClaimsRequest(claimsValue, ClaimsRequest.USERINFO)); claimsRequest.setIdTokenClaims(resolveClaimsRequest(claimsValue, ClaimsRequest.ID_TOKEN)); return claimsRequest; } catch (Exception e) { throw new ClaimsRequestSyntaxException(e); } }  ClaimsRequest resolve(String claims); }
ClaimsRequestResolver { public ClaimsRequest resolve(String claims) throws ClaimsRequestSyntaxException { try { JsonObject claimsValue = new JsonObject(claims); ClaimsRequest claimsRequest = new ClaimsRequest(); claimsRequest.setUserInfoClaims(resolveClaimsRequest(claimsValue, ClaimsRequest.USERINFO)); claimsRequest.setIdTokenClaims(resolveClaimsRequest(claimsValue, ClaimsRequest.ID_TOKEN)); return claimsRequest; } catch (Exception e) { throw new ClaimsRequestSyntaxException(e); } }  ClaimsRequest resolve(String claims);  }