Skip to content

Commit 10b7bd9

Browse files
committed
[MOSIP-41056] Updated the workflowa
Signed-off-by: pvsaidurga <[email protected]>
1 parent 3790097 commit 10b7bd9

File tree

3 files changed

+57
-29
lines changed

3 files changed

+57
-29
lines changed

compass-identity-plugin/pom.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,6 @@
8888
<version>${esignet.version}</version>
8989
<scope>provided</scope>
9090
</dependency>
91-
<dependency>
92-
<groupId>com.sun.xml.ws</groupId>
93-
<artifactId>jaxws-rt</artifactId>
94-
<version>2.3.3</version>
95-
</dependency>
96-
9791

9892
<dependency>
9993
<groupId>io.mosip.kernel</groupId>
@@ -123,11 +117,6 @@
123117
<version>1.7.30</version>
124118
<scope>provided</scope>
125119
</dependency>
126-
<dependency>
127-
<groupId>com.fasterxml.jackson.dataformat</groupId>
128-
<artifactId>jackson-dataformat-xml</artifactId>
129-
<version>2.9.8</version>
130-
</dependency>
131120
</dependencies>
132121
<build>
133122
<plugins>

compass-identity-plugin/src/main/java/io/compass/esignet/plugin/service/HelperService.java

Lines changed: 55 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ public class HelperService {
4747
@Value("${mosip.esignet.compass.authenticator.otp-value:111111}")
4848
private String otpValue;
4949

50-
@Value("#{${mosip.esignet.authenticator.compass.identity-openid-claims-mapping}}")
51-
private Map<String,String> oidcClaimsMapping;
52-
5350
@Autowired
5451
private CacheService cacheService;
5552

@@ -140,18 +137,62 @@ private String generateB64EncodedHash(String algorithm, String value) throws Kyc
140137
public Map<String, Object> buildKycDataBasedOnPolicy(List<String> claims, UserInfo userInfo) throws KycExchangeException {
141138
Map<String, Object> kyc = new HashMap<>();
142139
for (String claim : claims) {
143-
String methodName = oidcClaimsMapping.get(claim);
144-
145-
if (methodName != null) {
146-
try {
147-
Method method = UserInfo.class.getMethod(methodName);
148-
Object value = method.invoke(userInfo);
149-
if (value != null) {
150-
kyc.put(claim, value);
140+
switch (claim) {
141+
case "name":
142+
if (userInfo.getFirstNamePrimary() != null) {
143+
kyc.put("name", userInfo.getFirstNamePrimary());
151144
}
152-
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
153-
throw new KycExchangeException("Error invoking method for claim: "+claim,e.getMessage());
154-
}
145+
break;
146+
case "birthdate":
147+
if (userInfo.getDateOfBirth() != null) {
148+
kyc.put("birthdate", userInfo.getDateOfBirth());
149+
}
150+
break;
151+
case "birthCountry":
152+
if (userInfo.getBirthCountry() != null) {
153+
kyc.put("birthCountry", userInfo.getBirthCountry());
154+
}
155+
break;
156+
case "cardAccessNumber":
157+
if (userInfo.getCardAccessNumber() != null) {
158+
kyc.put("cardAccessNumber", userInfo.getCardAccessNumber());
159+
}
160+
break;
161+
case "email":
162+
if (userInfo.getEmail() != null) {
163+
kyc.put("email", userInfo.getEmail());
164+
}
165+
break;
166+
case "faceImageColor":
167+
if (userInfo.getFaceImageColor() != null) {
168+
kyc.put("faceImageColor", userInfo.getFaceImageColor());
169+
}
170+
break;
171+
case "gender":
172+
if (userInfo.getGender() != null) {
173+
kyc.put("gender", userInfo.getGender());
174+
}
175+
break;
176+
case "lastNameSecondary":
177+
if (userInfo.getLastNameSecondary() != null) {
178+
kyc.put("lastNameSecondary", userInfo.getLastNameSecondary());
179+
}
180+
break;
181+
case "nationalUid":
182+
if (userInfo.getNationalUid() != null) {
183+
kyc.put("nationalUid", userInfo.getNationalUid());
184+
}
185+
break;
186+
case "nationality":
187+
if (userInfo.getNationality() != null) {
188+
kyc.put("nationality", userInfo.getNationality());
189+
}
190+
break;
191+
case "compassId":
192+
if (userInfo.getCompassId() != null) {
193+
kyc.put("compassId", userInfo.getCompassId());
194+
}
195+
break;
155196
}
156197
}
157198
return kyc;
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
mosip.compass.generate-challenge.endpoint=http://otpmanager.kernel/v1/otpmanager/otp/generate
22
mosip.compass.send-notification.endpoint=http://notifier.kernel/v1/notifier/sms/send
3-
mosip.compass.user-info.endpoint=
3+
mosip.compass.user-info.endpoint= https://compass-admin.dev2.mosip.net/v1/admin/userinfo
44
mosip.esignet.identifier.prefix=+91
55
mosip.esignet.sms-notification-template.encoded-langcodes={'eng'}
6-
mosip.esignet.default-language=eng
7-
8-
mosip.esignet.authenticator.compass.identity-openid-claims-mapping={'name':'firstNamePrimary','birthdate':'dateOfBirth','birthCountry':'birthCountry','cardAccessNumber':'cardAccessNumber','email':'email','faceImageColor':'faceImageColor','gender':'gender','lastNameSecondary':'lastNameSecondary','nationalUid':'nationalUid','nationality':'nationality','compassId':'compassId'}
6+
mosip.esignet.default-language=eng

0 commit comments

Comments
 (0)