Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DSD-3884] Deleted sql files which are not required. Code Merge from develop to release-1201 #1136

Merged
merged 74 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
6c978f4
MOSIP-26891 added condition in caching (#1045)
Neha2365 Jul 3, 2023
cfb3eeb
Mosip 26891 caches in ida module should avoid caching null values (#1…
Neha2365 Jul 3, 2023
e08ecb2
Mosip 26891 caches in ida module should avoid caching null values (#1…
Neha2365 Jul 3, 2023
2eeb04d
Mosip 26891 caches in ida module should avoid caching null values (#1…
Neha2365 Jul 3, 2023
2663a46
Mosip 26891 caches in ida module should avoid caching null values (#1…
Neha2365 Jul 3, 2023
385dd45
[BUGFIX] [ES-176]
jainhitesh9998 Jul 19, 2023
0d8d7cc
Merge pull request #1054 from jainhitesh9998/bugfix-ES-176
vishwa-vyom Jul 19, 2023
82fee8f
iat validation corrected
anshulv1401 Jul 19, 2023
ede9bfc
Merge pull request #1055 from anshulv1401/develop
mahammedtaheer Jul 20, 2023
2f555fa
[MOSIP-28622] fixed firstname, lastname not populating in e-signet is…
mahammedtaheer Jul 27, 2023
a450107
Merge pull request #1056 from mahammedtaheer/develop
mahammedtaheer Jul 27, 2023
94794fb
[MOSIP-28484] Added error handling for deploy.sh script (#1061)
akilalakshmanan Aug 21, 2023
208b9c0
Implemented the VCI plugin in IDA
Aug 29, 2023
de7b9b5
Format the code
Aug 29, 2023
3fce833
Changes done
Aug 30, 2023
395eff4
Changes done
Aug 30, 2023
bed3ab2
Changes done
Aug 30, 2023
b14a44f
Decrypted the individualId
Aug 31, 2023
611400a
[ES-186] Added new Vci Exchange API to add support for VCI.
mahammedtaheer Sep 1, 2023
b3b29fb
Merge pull request #1074 from mahammedtaheer/develop
mahammedtaheer Sep 1, 2023
dcb7f68
Added new repo for LD signature library. (#1075)
mahammedtaheer Sep 5, 2023
b6ee915
updated push trigger to include settings.xml for sonar analysis and f…
mahammedtaheer Sep 5, 2023
773bdd5
Merge pull request #1076 from mahammedtaheer/develop
mahammedtaheer Sep 5, 2023
c6ad7df
removed show progress argument for wget command to display download p…
mahammedtaheer Sep 5, 2023
04122c6
Merge pull request #1077 from mahammedtaheer/develop
mahammedtaheer Sep 5, 2023
fd5f3be
Merge pull request #1073 from Neha2365/ES-187-mosip-ida-vc-provider-p…
mahammedtaheer Sep 5, 2023
d23f4a4
ES-107
Sep 5, 2023
4ce7470
Merge pull request #1078 from ase-101/binding
mahammedtaheer Sep 5, 2023
29f0e07
Fixed the cache read issue
Sep 5, 2023
8364700
Merge pull request #1080 from ase-101/binding
mahammedtaheer Sep 5, 2023
3440616
ES-187
Sep 6, 2023
1a72a3f
Merge pull request #1081 from ase-101/binding
mahammedtaheer Sep 6, 2023
726b86e
ES-187
Sep 6, 2023
3369075
Merge pull request #1082 from ase-101/binding
mahammedtaheer Sep 6, 2023
20b8efc
[ES-186] Fixed integration issues.
mahammedtaheer Sep 6, 2023
d5f908e
Merge pull request #1083 from mahammedtaheer/develop
mahammedtaheer Sep 6, 2023
975616d
ES-187
Sep 6, 2023
1fbdf68
Merge pull request #1084 from ase-101/binding
mahammedtaheer Sep 6, 2023
e2f67cf
[ES-186] changed the VC ID to UUID instead of PSUT and added locales.
mahammedtaheer Sep 8, 2023
6640467
Merge pull request #1085 from mahammedtaheer/develop
mahammedtaheer Sep 8, 2023
75abafc
[MOSIP-29163] updated reusable workflows (#1088)
bhumi46 Sep 8, 2023
02d0c0b
merge from release-1.2.0.1 to develop (#1089)
mahammedtaheer Sep 11, 2023
e7b2053
ES-187 (#1092)
ase-101 Sep 14, 2023
181e784
[ES-280], [ES-281] (#1094)
mahammedtaheer Sep 15, 2023
384b193
Fixed test cases error. (#1095)
mahammedtaheer Sep 15, 2023
c60fa2b
Fixed Test cases error. (#1096)
mahammedtaheer Sep 15, 2023
8046ca9
Fixed test case error. (#1097)
mahammedtaheer Sep 15, 2023
fa35a3c
Fixed Test cases error. (#1098)
mahammedtaheer Sep 15, 2023
b60338b
[ES-261] test cases for idaVCIssuancePluginImpl (#1093)
kaifk468 Sep 21, 2023
d5386bc
[ES-261] changes in testCases for IdaVCIssuancePluginImpl (#1100)
kaifk468 Sep 25, 2023
1d42341
[MOSIP-29163] updated reusable workflows (#1103)
bhumi46 Sep 25, 2023
e8281e3
[ES-313] Fixed blank attribute issue & language not available issue. …
mahammedtaheer Oct 3, 2023
a950201
ES-261 (#1108)
ase-101 Oct 6, 2023
e4f69eb
[MOSIP-29888]Update pom.xml (#1109)
Mahesh-Binayak Oct 19, 2023
ea15962
[MOSIP-29801] Fixed less number of path parameters, api key expire er…
mahammedtaheer Oct 19, 2023
9e56929
Merge code from release to develop. (#1121)
mahammedtaheer Oct 31, 2023
3bcb2e0
[ES-309] fixed residenceStatus attribute issue in VCI. (#1122)
mahammedtaheer Oct 31, 2023
2c870cb
Added test case for coverage (#1123)
kaifk468 Nov 3, 2023
bd89d8b
added test to increase test the coverage (#1124)
kaifk468 Nov 3, 2023
fd1b3c4
[ES-417] (#1126)
pvsaidurga Nov 7, 2023
6f0b220
added coverage (#1127)
pvsaidurga Nov 8, 2023
88e95da
[MOSIP-29918] add db-test.yml (#1129)
Rakshithb1 Nov 15, 2023
8e265d5
[ES-418] Added password based auth support. (#1132)
mahammedtaheer Nov 20, 2023
a9daa74
[ES-482] changed logic to create list object. Change password and sal…
mahammedtaheer Nov 28, 2023
bd7d6c2
[MOSIP-30363], [ES-472], [ES-497] fixed this Jira issues. (#1137)
mahammedtaheer Dec 4, 2023
1bc2027
[MOSIP-30570] added new table in ddl.sql file. (#1138)
mahammedtaheer Dec 4, 2023
696dacf
[ES-529] changed the acr value of password to pwd. (#1139)
mahammedtaheer Dec 7, 2023
0e08f23
[MOSIP-29961] Updated push-trigger.yml (#1142)
Rakshithb1 Dec 13, 2023
9b5c759
ES-421 Updated credential_transaction_id column length in credential_…
ase-101 Dec 13, 2023
e5dca37
[ES-421] (#1145)
ase-101 Dec 14, 2023
720a099
[DSD-4096] (#1149)
Rakshitha650 Jan 3, 2024
cb69aff
code merge from develop to release-1201 branch.
mahammedtaheer Jan 3, 2024
0b20cf9
Correct pom version.
mahammedtaheer Jan 4, 2024
9b3ecf3
Update pom version to SNAPSHOT.
mahammedtaheer Jan 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
secrets:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_URL: ${{ secrets.RELEASE_URL }}
OSSRH_URL: ${{ secrets.OSSRH_SNAPSHOT_URL }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
Expand Down
4 changes: 2 additions & 2 deletions authentication/authentication-authtypelockfilter-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<parent>
<groupId>io.mosip.authentication</groupId>
<artifactId>authentication-parent</artifactId>
<version>1.2.0.1-B5</version>
<version>1.2.0.1-SNAPSHOT</version>
</parent>
<version>1.2.0.1-B5</version>
<version>1.2.0.1-SNAPSHOT</version>
<artifactId>authentication-authtypelockfilter-impl</artifactId>
<name>authentication-authtypelockfilter-impl</name>
<description>ID Authentication Filter Implementation for Auth Type Lock validation</description>
Expand Down
4 changes: 2 additions & 2 deletions authentication/authentication-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<parent>
<groupId>io.mosip.authentication</groupId>
<artifactId>authentication-parent</artifactId>
<version>1.2.0.1-B5</version>
<version>1.2.0.1-SNAPSHOT</version>
</parent>
<version>1.2.0.1-B5</version>
<version>1.2.0.1-SNAPSHOT</version>
<artifactId>authentication-common</artifactId>
<name>authentication-common</name>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,7 @@ public class IDAMappingConfig implements MappingConfig {
/** The dynamic attributes. */
private Map<String, List<String>> dynamicAttributes;

/** The password. */
private List<String> password;

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import io.mosip.authentication.common.service.helper.AuditHelper;
import io.mosip.authentication.common.service.helper.AuthTransactionHelper;
import io.mosip.authentication.common.service.helper.IdInfoHelper;
import io.mosip.authentication.common.service.impl.match.IdaIdMapping;
import io.mosip.authentication.common.service.integration.TokenIdManager;
import io.mosip.authentication.common.service.transaction.manager.IdAuthSecurityManager;
import io.mosip.authentication.common.service.util.AuthTypeUtil;
Expand All @@ -47,6 +48,7 @@
import io.mosip.authentication.core.indauth.dto.AuthStatusInfo;
import io.mosip.authentication.core.indauth.dto.IdType;
import io.mosip.authentication.core.indauth.dto.IdentityInfoDTO;
import io.mosip.authentication.core.indauth.dto.KycAuthRequestDTO;
import io.mosip.authentication.core.indauth.dto.EkycAuthRequestDTO;
import io.mosip.authentication.core.logger.IdaLogger;
import io.mosip.authentication.core.partner.dto.PartnerPolicyResponseDTO;
Expand All @@ -58,6 +60,7 @@
import io.mosip.authentication.core.spi.indauth.service.BioAuthService;
import io.mosip.authentication.core.spi.indauth.service.DemoAuthService;
import io.mosip.authentication.core.spi.indauth.service.OTPAuthService;
import io.mosip.authentication.core.spi.indauth.service.PasswordAuthService;
import io.mosip.authentication.core.spi.notification.service.NotificationService;
import io.mosip.authentication.core.spi.partner.service.PartnerService;
import io.mosip.kernel.core.logger.spi.Logger;
Expand Down Expand Up @@ -129,6 +132,9 @@ public class AuthFacadeImpl implements AuthFacade {

@Autowired
private KeyBindedTokenAuthService keyBindedTokenAuthService;

@Autowired
private PasswordAuthService passwordAuthService;

/*
* (non-Javadoc)
Expand Down Expand Up @@ -161,6 +167,14 @@ public AuthResponseDTO authenticateIndividual(AuthRequestDTO authRequestDTO, boo

addKycPolicyAttributes(filterAttributes, kycAuthRequestDTO);
}

if(authRequestDTO instanceof KycAuthRequestDTO) {
KycAuthRequestDTO kycAuthRequestDTO = (KycAuthRequestDTO) authRequestDTO;
// In case of kyc-auth request and password auth is requested
if(AuthTypeUtil.isPassword(kycAuthRequestDTO)) {
filterAttributes.add(IdaIdMapping.PASSWORD.getIdname());
}
}

Map<String, Object> idResDTO = idService.processIdType(idvIdType, idvid, idInfoHelper.isBiometricDataNeeded(authRequestDTO),
markVidConsumed, filterAttributes);
Expand Down Expand Up @@ -312,6 +326,11 @@ private List<AuthStatusInfo> processAuthType(AuthRequestDTO authRequestDTO,
authTxnBuilder, idvidHash);
}

if (!isMatchFailed(authStatusList)) {
processPasswordAuth(authRequestDTO, idInfo, token, isAuth, authStatusList, idType, authTokenId, partnerId,
authTxnBuilder, idvidHash);
}

return authStatusList;
}

Expand Down Expand Up @@ -383,7 +402,7 @@ private void processDemoAuth(AuthRequestDTO authRequestDTO, Map<String, List<Ide
statusInfo = demoValidationStatus;

boolean isStatus = statusInfo != null && statusInfo.isStatus();
auditHelper.audit(AuditModules.DEMO_AUTH, getAuditEvent(isAuth), idvidHash,
auditHelper.audit(AuditModules.DEMO_AUTH, getAuditEvent(isAuth), authRequestDTO.getTransactionID(),
idType, "authenticateApplicant status : " + isStatus);
} catch (IdAuthUncheckedException e) {
throw new IdAuthenticationBusinessException(e.getErrorCode(), e.getErrorText());
Expand Down Expand Up @@ -423,7 +442,7 @@ private void processOTPAuth(AuthRequestDTO authRequestDTO, String token, boolean
authStatusList.add(otpValidationStatus);

boolean isStatus = otpValidationStatus != null && otpValidationStatus.isStatus();
auditHelper.audit(AuditModules.OTP_AUTH, getAuditEvent(isAuth), idvidHash,
auditHelper.audit(AuditModules.OTP_AUTH, getAuditEvent(isAuth), authRequestDTO.getTransactionID(),
idType, "authenticateApplicant status : " + isStatus);
} finally {
boolean isStatus = otpValidationStatus != null && otpValidationStatus.isStatus();
Expand Down Expand Up @@ -464,16 +483,16 @@ private void saveAndAuditBioAuthTxn(AuthRequestDTO authRequestDTO, String token,
String status = "authenticateApplicant status : " + isStatus;
if (AuthTransactionHelper.isFingerAuth(authRequestDTO, env)) {
auditHelper.audit(AuditModules.FINGERPRINT_AUTH, getAuditEvent(!isInternal),
idvidHash, idType, status);
authRequestDTO.getTransactionID(), idType, status);
authTxnBuilder.addRequestType(RequestType.FINGER_AUTH);
}
if (AuthTransactionHelper.isIrisAuth(authRequestDTO, env)) {
auditHelper.audit(AuditModules.IRIS_AUTH, getAuditEvent(!isInternal), idvidHash,
auditHelper.audit(AuditModules.IRIS_AUTH, getAuditEvent(!isInternal), authRequestDTO.getTransactionID(),
idType, status);
authTxnBuilder.addRequestType(RequestType.IRIS_AUTH);
}
if (AuthTransactionHelper.isFaceAuth(authRequestDTO, env)) {
auditHelper.audit(AuditModules.FACE_AUTH, getAuditEvent(!isInternal), idvidHash,
auditHelper.audit(AuditModules.FACE_AUTH, getAuditEvent(!isInternal), authRequestDTO.getTransactionID(),
idType, status);
authTxnBuilder.addRequestType(RequestType.FACE_AUTH);
}
Expand Down Expand Up @@ -503,7 +522,7 @@ private void processTokenAuth(AuthRequestDTO authRequestDTO, Map<String, List<Id
authStatusList.add(tokenValidationStatus);

boolean isStatus = tokenValidationStatus != null && tokenValidationStatus.isStatus();
auditHelper.audit(AuditModules.TOKEN_AUTH, getAuditEvent(isAuth), idvidHash,
auditHelper.audit(AuditModules.TOKEN_AUTH, getAuditEvent(isAuth), authRequestDTO.getTransactionID(),
idType, "authenticateApplicant status : " + isStatus);
} finally {
boolean isStatus = tokenValidationStatus != null && tokenValidationStatus.isStatus();
Expand All @@ -513,5 +532,39 @@ private void processTokenAuth(AuthRequestDTO authRequestDTO, Map<String, List<Id
}
}
}

/**
*
* @param authRequestDTO
* @param token
* @param isAuth
* @param authStatusList
* @param idType
* @param authTokenId
* @param partnerId
* @param authTxnBuilder
* @param idvidHash
* @throws IdAuthenticationBusinessException
*/
private void processPasswordAuth(AuthRequestDTO authRequestDTO, Map<String, List<IdentityInfoDTO>> idInfo, String token,
boolean isAuth, List<AuthStatusInfo> authStatusList, IdType idType, String authTokenId, String partnerId,
AuthTransactionBuilder authTxnBuilder, String idvidHash) throws IdAuthenticationBusinessException {
if (AuthTypeUtil.isPassword(authRequestDTO)) {
AuthStatusInfo passwordMatchStatus = null;
try {
passwordMatchStatus = passwordAuthService.authenticate(authRequestDTO, token, idInfo, partnerId);
authStatusList.add(passwordMatchStatus);

boolean isStatus = passwordMatchStatus != null && passwordMatchStatus.isStatus();
auditHelper.audit(AuditModules.PASSWORD_AUTH, AuditEvents.PASSWORD_BASED_AUTH_REQUEST, authRequestDTO.getTransactionID(),
idType, "authenticateApplicant status(Password) : " + isStatus);
} finally {
boolean isStatus = passwordMatchStatus != null && passwordMatchStatus.isStatus();
logger.info(IdAuthCommonConstants.SESSION_ID, EnvUtil.getAppId(),
AUTH_FACADE, "Password Authentication status : " + isStatus);
authTxnBuilder.addRequestType(RequestType.PASSWORD_AUTH);
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,12 @@ protected String consumeResponse(ResettableStreamHttpServletRequest requestWrapp
String requestSignature = requestWrapper.getHeader(SIGNATURE);
String responseSignature = null;
if(isSigningRequired()) {
if (Objects.isNull(responseAsString) || responseAsString.trim().length() == 0) {
mosipLogger.error(IdAuthCommonConstants.SESSION_ID, EVENT_FILTER, BASE_IDA_FILTER,
" Response String is null or empty for response (JWT) signing");
throw new IdAuthenticationAppException(IdAuthenticationErrorConstants.UNABLE_TO_PROCESS.getErrorCode(),
IdAuthenticationErrorConstants.UNABLE_TO_PROCESS.getErrorMessage());
}
responseSignature = keyManager.signResponse(responseAsString);
responseWrapper.setHeader(EnvUtil.getSignResponse(), responseSignature);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import javax.servlet.ServletException;

import io.mosip.authentication.core.indauth.dto.KeyBindedTokenDTO;
import io.mosip.authentication.core.indauth.dto.KycAuthRequestDTO;

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
Expand Down Expand Up @@ -843,6 +845,7 @@ protected void checkAllowedAuthTypeForKeyBindedToken(Map<String, Object> request
Object value = Optional.ofNullable(requestBody.get(IdAuthCommonConstants.REQUEST))
.filter(obj -> obj instanceof Map).map(obj -> ((Map<String, Object>) obj).get(KEY_BINDED_TOKEN))
.filter(obj -> obj instanceof List).orElse(Collections.emptyMap());

List<KeyBindedTokenDTO> list = mapper.readValue(mapper.writeValueAsBytes(value),
new TypeReference<List<KeyBindedTokenDTO>>() {
});
Expand All @@ -861,6 +864,19 @@ protected void checkAllowedAuthTypeForKeyBindedToken(Map<String, Object> request
}
}

protected void checkAllowedAuthTypeForPassword(Map<String, Object> requestBody, List<AuthPolicy> authPolicies)
throws IdAuthenticationAppException, IOException {
KycAuthRequestDTO authRequestDTO = mapper.readValue(mapper.writeValueAsBytes(requestBody),
KycAuthRequestDTO.class);

if (AuthTypeUtil.isPassword(authRequestDTO) && !isAllowedAuthType(MatchType.Category.PWD.getType(), authPolicies)) {
throw new IdAuthenticationAppException(
IdAuthenticationErrorConstants.AUTHTYPE_NOT_ALLOWED.getErrorCode(),
String.format(IdAuthenticationErrorConstants.AUTHTYPE_NOT_ALLOWED.getErrorMessage(),
MatchType.Category.PWD.name()));
}
}

/**
* Check allowed auth type for bio.
*
Expand Down Expand Up @@ -1042,16 +1058,25 @@ private void checkAllowedAMRBasedOnClientConfig(Map<String, Object> requestBody,

if (AuthTypeUtil.isPin(authRequestDTO) && !allowedAMRs.contains(MatchType.Category.SPIN.getType())) {
throw new IdAuthenticationAppException(
IdAuthenticationErrorConstants.AUTHTYPE_NOT_ALLOWED.getErrorCode(),
String.format(IdAuthenticationErrorConstants.AUTHTYPE_NOT_ALLOWED.getErrorMessage(),
IdAuthenticationErrorConstants.OIDC_CLIENT_AUTHTYPE_NOT_ALLOWED.getErrorCode(),
String.format(IdAuthenticationErrorConstants.OIDC_CLIENT_AUTHTYPE_NOT_ALLOWED.getErrorMessage(),
MatchType.Category.SPIN.name()));
}
if (AuthTypeUtil.isOtp(authRequestDTO) && !allowedAMRs.contains(MatchType.Category.OTP.getType())) {
throw new IdAuthenticationAppException(
IdAuthenticationErrorConstants.AUTHTYPE_NOT_ALLOWED.getErrorCode(),
String.format(IdAuthenticationErrorConstants.AUTHTYPE_NOT_ALLOWED.getErrorMessage(),
IdAuthenticationErrorConstants.OIDC_CLIENT_AUTHTYPE_NOT_ALLOWED.getErrorCode(),
String.format(IdAuthenticationErrorConstants.OIDC_CLIENT_AUTHTYPE_NOT_ALLOWED.getErrorMessage(),
MatchType.Category.OTP.name()));
}

KycAuthRequestDTO kycAuthRequestDTO = mapper.readValue(mapper.writeValueAsBytes(requestBody),
KycAuthRequestDTO.class);
if (AuthTypeUtil.isPassword(kycAuthRequestDTO) && !allowedAMRs.contains(MatchType.Category.PWD.getType())) {
throw new IdAuthenticationAppException(
IdAuthenticationErrorConstants.OIDC_CLIENT_AUTHTYPE_NOT_ALLOWED.getErrorCode(),
String.format(IdAuthenticationErrorConstants.OIDC_CLIENT_AUTHTYPE_NOT_ALLOWED.getErrorMessage(),
MatchType.Category.PWD.name()));
}
checkAllowedAMRForKBT(requestBody, allowedAMRs);
}
} catch (IOException e) {
Expand Down Expand Up @@ -1119,19 +1144,28 @@ private Set<String> getAuthenticationFactors(PartnerPolicyResponseDTO partnerPol
* @param requestWrapper the request wrapper
* @return the auth part
*/
protected Map<String, String> getAuthPart(ResettableStreamHttpServletRequest requestWrapper) {
protected Map<String, String> getAuthPart(ResettableStreamHttpServletRequest requestWrapper) throws IdAuthenticationAppException{
Map<String, String> params = new HashMap<>();
String url = requestWrapper.getRequestURL().toString();
String contextPath = requestWrapper.getContextPath();
if ((Objects.nonNull(url) && !url.isEmpty()) && (Objects.nonNull(contextPath) && !contextPath.isEmpty())) {
String[] splitedUrlByContext = url.split(contextPath);
String[] paramsArray = Stream.of(splitedUrlByContext[1].split("/")).filter(str -> !str.isEmpty())
.toArray(size -> new String[size]);
.toArray(size -> new String[size]);
mosipLogger.info(IdAuthCommonConstants.SESSION_ID, this.getClass().getCanonicalName(), "getAuthPart",
"List of Path Parameters received in url: " + Stream.of(paramsArray).collect(Collectors.joining(", ")));

if (paramsArray.length >= 3) {
params.put(MISPLICENSE_KEY, paramsArray[paramsArray.length - 3]);
params.put(PARTNER_ID, paramsArray[paramsArray.length - 2]);
params.put(API_KEY, paramsArray[paramsArray.length - 1]);
} else {
mosipLogger.error(IdAuthCommonConstants.SESSION_ID, this.getClass().getCanonicalName(), "getAuthPart",
"Required Number of Path Parameters are not available in URL.");
throw new IdAuthenticationAppException(
IdAuthenticationErrorConstants.URI_PATH_PARAMS_MISSING.getErrorCode(),
IdAuthenticationErrorConstants.URI_PATH_PARAMS_MISSING.getErrorMessage());

}
}
return params;
Expand Down
Loading
Loading