protected String getFirstClaim(final UserInfoResponse userInfoResponse, final String claimName) { final List<String> claims = userInfoResponse.getClaim(claimName); if ((claims == null) || claims.isEmpty()) { return null; } return claims.get(0); }
assertNotNull(response2.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(response2.getClaim(JwtClaimName.NAME)); assertNotNull(response2.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(response2.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(response2.getClaim(JwtClaimName.EMAIL)); assertNotNull(response2.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(response2.getClaim(JwtClaimName.LOCALE)); assertNotNull(response2.getClaim(JwtClaimName.ADDRESS)); assertNull(response2.getClaim("org_name")); assertNull(response2.getClaim("work_phone"));
assertNotNull(response2.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(response2.getClaim(JwtClaimName.NAME)); assertNotNull(response2.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(response2.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(response2.getClaim(JwtClaimName.EMAIL)); assertNotNull(response2.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(response2.getClaim(JwtClaimName.LOCALE)); assertNotNull(response2.getClaim(JwtClaimName.ADDRESS)); assertNull(response2.getClaim("phone_mobile_number"));
assertNotNull(response2.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(response2.getClaim(JwtClaimName.NAME)); assertNotNull(response2.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(response2.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(response2.getClaim(JwtClaimName.EMAIL)); assertNotNull(response2.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(response2.getClaim(JwtClaimName.LOCALE)); assertNotNull(response2.getClaim(JwtClaimName.ADDRESS)); assertNotNull(response2.getClaim("org_name")); assertNotNull(response2.getClaim("work_phone"));
private UserInfoResponse requestUserInfo(String accessToken) throws Exception { UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setExecutor(clientExecutor(true)); UserInfoResponse response2 = userInfoClient.execUserInfo(accessToken); assertNotNull(response2.getClaim(JwtClaimName.EMAIL)); return response2; }
assertNotNull(response2.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(response2.getClaim(JwtClaimName.NAME)); assertNotNull(response2.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(response2.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(response2.getClaim(JwtClaimName.EMAIL)); assertNotNull(response2.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(response2.getClaim(JwtClaimName.LOCALE)); assertNull(response2.getClaim("org_name")); assertNull(response2.getClaim("work_phone"));
assertNotNull(response2.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(response2.getClaim(JwtClaimName.NAME)); assertNotNull(response2.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(response2.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(response2.getClaim(JwtClaimName.EMAIL)); assertNotNull(response2.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(response2.getClaim(JwtClaimName.LOCALE)); assertNotNull(response2.getClaim("org_name")); assertNotNull(response2.getClaim("work_phone"));
assertNotNull(response2.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(response2.getClaim(JwtClaimName.NAME)); assertNotNull(response2.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(response2.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(response2.getClaim(JwtClaimName.EMAIL)); assertNotNull(response2.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(response2.getClaim(JwtClaimName.LOCALE)); assertNull(response2.getClaim("phone_mobile_number"));
assertNotNull(userInfoResponse.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ISSUER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.AUDIENCE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.PICTURE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.EMAIL)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.LOCALE));
assertNotNull(userInfoResponse.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ISSUER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.AUDIENCE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.PICTURE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.EMAIL)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.LOCALE));
assertNotNull(userInfoResponse.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ISSUER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.AUDIENCE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.PICTURE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.EMAIL)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.LOCALE));
assertNotNull(userInfoResponse.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ISSUER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.AUDIENCE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.PICTURE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.EMAIL)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.LOCALE));
assertNotNull(userInfoResponse.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ISSUER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.AUDIENCE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.PICTURE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.EMAIL)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.LOCALE));
assertNotNull(userInfoResponse.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ISSUER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.AUDIENCE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.PICTURE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.EMAIL)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.LOCALE));
assertNotNull(response2.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(response2.getClaim(JwtClaimName.NAME)); assertNotNull(response2.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(response2.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(response2.getClaim(JwtClaimName.EMAIL)); assertNotNull(response2.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(response2.getClaim(JwtClaimName.LOCALE));
assertNotNull(userInfoResponse.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ISSUER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.AUDIENCE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.PICTURE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.EMAIL)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.LOCALE));
assertNotNull(userInfoResponse.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ISSUER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.AUDIENCE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.PICTURE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.EMAIL)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.LOCALE));
assertNotNull(userInfoResponse.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.EMAIL)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.LOCALE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.PICTURE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ADDRESS));
assertNotNull(userInfoResponse.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.PICTURE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.EMAIL)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.LOCALE));
assertNotNull(userInfoResponse.getClaim(JwtClaimName.SUBJECT_IDENTIFIER)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.GIVEN_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.FAMILY_NAME)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.PICTURE)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.EMAIL)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.ZONEINFO)); assertNotNull(userInfoResponse.getClaim(JwtClaimName.LOCALE));