private Map<String, Object> getIdTokenClaims(AuthenticationContext context, String idToken) { context.setProperty(OIDCAuthenticatorConstants.ID_TOKEN, idToken); String base64Body = idToken.split("\\.")[1]; byte[] decoded = Base64.decodeBase64(base64Body.getBytes()); Set<Map.Entry<String, Object>> jwtAttributeSet = new HashSet<>(); try { jwtAttributeSet = JSONObjectUtils.parseJSONObject(new String(decoded)).entrySet(); } catch (ParseException e) { log.error("Error occurred while parsing JWT provided by federated IDP: ", e); } Map<String, Object> jwtAttributeMap = new HashMap(); for(Map.Entry<String, Object> entry : jwtAttributeSet) { jwtAttributeMap.put(entry.getKey(), entry.getValue()); } return jwtAttributeMap; }
final JSONObject internal = JSONObjectUtils.parseJSONObject(String.valueOf(claims.getClaim(Claims.TAG_INTERNAL.getName())));
final ReadOnlyJWTClaimsSet previousCS = signedPreviousRT.getJWTClaimsSet(); final String tagInternalPayload = String.valueOf(previousCS.getClaim(Claims.TAG_INTERNAL.getName())); final JSONObject tagInternal = JSONObjectUtils.parseJSONObject(tagInternalPayload);