diff --git a/sunbird-rc-plugin/src/main/java/io/mosip/esignet/plugin/sunbirdrc/service/SunbirdRCAuthenticationService.java b/sunbird-rc-plugin/src/main/java/io/mosip/esignet/plugin/sunbirdrc/service/SunbirdRCAuthenticationService.java index 4f41a23..b5c215e 100644 --- a/sunbird-rc-plugin/src/main/java/io/mosip/esignet/plugin/sunbirdrc/service/SunbirdRCAuthenticationService.java +++ b/sunbird-rc-plugin/src/main/java/io/mosip/esignet/plugin/sunbirdrc/service/SunbirdRCAuthenticationService.java @@ -145,11 +145,8 @@ public KycExchangeResult doKycExchange(String relyingPartyId, String clientId, K if (kycExchangeDto.getAcceptedClaims() == null) { kycExchangeDto.setAcceptedClaims(new ArrayList<>()); } - for (String acceptedClaim : kycExchangeDto.getAcceptedClaims()) { - if (!kycExchangeDto.getAcceptedClaims().contains(acceptedClaim)) { - kycExchangeDto.getAcceptedClaims().add(acceptedClaim); - } - } + Set uniqueClaims = new LinkedHashSet<>(kycExchangeDto.getAcceptedClaims()); + kycExchangeDto.setAcceptedClaims(new ArrayList<>(uniqueClaims)); responseRegistryMap =fetchRegistryObject(registryUrl+ kycToken); if (responseRegistryMap == null) { throw new KycExchangeException(ErrorConstants.DATA_EXCHANGE_FAILED);