From 8832ad7fb7b5e92338ccc24b554aabbf031c2b6c Mon Sep 17 00:00:00 2001 From: pvsaidurga <132046494+pvsaidurga@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:00:18 +0530 Subject: [PATCH] Update SunbirdRCAuthenticationService.java Signed-off-by: pvsaidurga <132046494+pvsaidurga@users.noreply.github.com> --- .../sunbirdrc/service/SunbirdRCAuthenticationService.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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);