security module- login screen #1

Merged
mubashar.hussain merged 1 commits from SecurityModuleChanges into FMFI-PRE-PRODUCTION 1 week ago

@ -1,6 +1,7 @@
package com.mfsys.common.configuration.constant;
public interface AconnectURI {
String ACONNECT = "/aconnect";
String REFRESH_TOKEN = "/refreshtoken";
String DEPOSIT = "/deposit";
String GENERALLEDGER = "/generalledger";

@ -6,6 +6,7 @@ import java.util.List;
public interface TokenBypassURI {
List<String> URIs = new ArrayList<String>(Arrays.asList(
"/aconnect/authentication/login",
"/aconnect/signin",
"/aconnect/transactions/accounttogl",
"/aconnect/account/miscDetails",

@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.crypto.SecretKey;
import java.nio.charset.StandardCharsets;
import java.security.Key;
import java.time.Instant;
import java.util.Date;
@ -91,7 +92,7 @@ public class JwtService {
}
private Key getSigningKey() {
byte[] keyBytes = secret.getBytes();
byte[] keyBytes = secret.getBytes(StandardCharsets.UTF_8);
return Keys.hmacShaKeyFor(keyBytes);
}
}

@ -88,18 +88,18 @@
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.12.3</version>
<version>0.12.6</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>0.12.3</version>
<version>0.12.6</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>0.12.3</version>
<version>0.12.6</version>
<scope>runtime</scope>
</dependency>

@ -13,8 +13,7 @@ import org.springframework.http.HttpHeaders;
import java.time.LocalDate;
import java.util.Map;
import static com.mfsys.common.configuration.constant.AconnectURI.DEPOSIT_CIIHIVE_ACCOUNT_MISCELLANEOUS_DETAILS_URI;
import static com.mfsys.common.configuration.constant.AconnectURI.*;
@Service
@ -59,7 +58,7 @@ public class TransactionService {
}
String porOrgacode = accountGLTransactionRequest.getPorOrgacode();
String url = depositURI + "/deposit/" + "/organizations/" + porOrgacode + "/transactions/accounttogls";
String url = depositURI + "/deposit/" + "/organizations/" + porOrgacode + "/transactions" + ACONNECT + "/accounttogls";
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", tokenHeader);
@ -90,7 +89,7 @@ public class TransactionService {
.body("Credit and Debit amounts must be equal");
}
String porOrgacode = gLtoGLRequest.getPorOrgacode();
String url = generalledgerURI + "/generalledger/" + "/organizations/" + porOrgacode + "/transactions/gltogls";
String url = generalledgerURI + "/generalledger/" + "/organizations/" + porOrgacode + "/transactions" + ACONNECT +"/gltogls";
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", tokenHeader);
headers.set("POR_ORGACODE", porOrgacode);
@ -111,7 +110,7 @@ public class TransactionService {
}
public Object processDepositAuthTransaction(DepositAuthorizationRequest authorizationRequest, String tokenHeader) {
String porOrgacode = authorizationRequest.getPorOrgacode();
String url = depositURI + "/deposit/" + "/organizations/" + porOrgacode + "/transactions/authorizations";
String url = depositURI + "/deposit/" + "/organizations/" + porOrgacode + "/transactions" + ACONNECT + "/authorizations";
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", tokenHeader);
headers.set("POR_ORGACODE", porOrgacode);
@ -158,7 +157,7 @@ public class TransactionService {
String porOrgacode = reversalRequest.getPorOrgacode();
String nodeID = reversalRequest.getNodeId();
String sgtGntrtranlink = reversalRequest.getSgtGntrtranlink();
String url = depositURI + "/deposit/" + "/organizations/" + porOrgacode + "/transactions/reversals/nodes/" + nodeID + "/trannums/" + sgtGntrtranlink;
String url = depositURI + "/deposit/" + "/organizations/" + porOrgacode + "/transactions" + ACONNECT + "/reversals/nodes/" + nodeID + "/trannums/" + sgtGntrtranlink;
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", tokenHeader);
headers.set("POR_ORGACODE", porOrgacode);
@ -183,7 +182,7 @@ public class TransactionService {
String nodeID = reversalRequest.getNodeId();
String sgtGntrtranlink = reversalRequest.getSgtGntrtranlink();
String url = generalledgerURI + "/generalledger/" + "/organizations/" + porOrgacode + "/transactions/reversals/nodes/" + nodeID + "/trannums/" + sgtGntrtranlink;
String url = generalledgerURI + "/generalledger/" + "/organizations/" + porOrgacode + "/transactions"+ ACONNECT +"/reversals/nodes/" + nodeID + "/trannums/" + sgtGntrtranlink;
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", tokenHeader);
headers.set("POR_ORGACODE", porOrgacode);
@ -205,7 +204,7 @@ public class TransactionService {
public Object processDepositRejectionTransaction(DepositRejectDTO rejectRequest, String tokenHeader) {
String porOrgacode = rejectRequest.getPorOrgacode();
String url = depositURI + "/deposit/" + "/organizations/" + porOrgacode + "/transactions/rejection";
String url = depositURI + "/deposit/" + "/organizations/" + porOrgacode + "/transactions" + ACONNECT +"/rejection";
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", tokenHeader);
headers.set("POR_ORGACODE", porOrgacode);
@ -227,7 +226,7 @@ public class TransactionService {
public Object processGLRejectionTransaction(DepositRejectDTO rejectRequest, String tokenHeader) {
String porOrgacode = rejectRequest.getPorOrgacode();
String url = generalledgerURI + "/generalledger/" + "/organizations/" + porOrgacode + "/transactions/rejection";
String url = generalledgerURI + "/generalledger/" + "/organizations/" + porOrgacode + "/transactions" + ACONNECT +"/rejection";
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", tokenHeader);
headers.set("POR_ORGACODE", porOrgacode);
@ -248,8 +247,8 @@ public class TransactionService {
}
public Object processDepositCancellationTransaction(DepositCancellationDTO depositCancellationDTO, String tokenHeader) {
String porOrgacode = depositCancellationDTO.getPorOrgacode();
String url = depositURI + "/deposit/" + "/organizations/" + depositCancellationDTO.getPorOrgacode() +
"/transactions/cancel/nodes/" + depositCancellationDTO.getNodeId() +
String url = depositURI + "/deposit" + "/organizations/" + depositCancellationDTO.getPorOrgacode() +
"/transactions" + ACONNECT + "/cancel/nodes/" + depositCancellationDTO.getNodeId() +
"/trannums/" + depositCancellationDTO.getSgtGntrtranlink();
HttpHeaders headers = new HttpHeaders();
@ -273,8 +272,8 @@ public class TransactionService {
public Object processGLCancellationTransaction(GLCancellationDTO glCancellationDTO, String tokenHeader) {
String porOrgacode = glCancellationDTO.getPorOrgacode();
String url = generalledgerURI + "/generalledger/" + "/organizations/" + glCancellationDTO.getPorOrgacode() +
"/transactions/cancel/nodes/" + glCancellationDTO.getNodeId() +
String url = generalledgerURI + GENERALLEDGER + "/organizations/" + glCancellationDTO.getPorOrgacode() +
"/transactions" + ACONNECT + "/cancel/nodes/" + glCancellationDTO.getNodeId() +
"/trannums/" + glCancellationDTO.getSgtGntrtranlink();
HttpHeaders headers = new HttpHeaders();

@ -15,7 +15,7 @@ spring.jpa.properties.hibernate.connection.useUnicode=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=update
jwt.secret = mySecretKey123456789012345678901234567890
jwt.secret = D1kD4fP8wQ2zL6hM9sR3vX7yU0tJ5nB2cV8pG4qW6eY1iK3oA9uH7jN2mZ5xT9bS4rF0lP3dQ8wE1
jwt.expiration = 86400000
jwt.refresh-expiration= 604800000

@ -15,7 +15,7 @@ spring.jpa.properties.hibernate.connection.useUnicode=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=update
jwt.secret = mySecretKey123456789012345678901234567890
jwt.secret = D1kD4fP8wQ2zL6hM9sR3vX7yU0tJ5nB2cV8pG4qW6eY1iK3oA9uH7jN2mZ5xT9bS4rF0lP3dQ8wE1
jwt.expiration = 86400000
jwt.refresh-expiration= 604800000

@ -15,7 +15,7 @@ spring.jpa.properties.hibernate.connection.useUnicode=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=update
jwt.secret = mySecretKey123456789012345678901234567890
jwt.secret = D1kD4fP8wQ2zL6hM9sR3vX7yU0tJ5nB2cV8pG4qW6eY1iK3oA9uH7jN2mZ5xT9bS4rF0lP3dQ8wE1
jwt.expiration = 86400000
jwt.refresh-expiration= 604800000

@ -15,7 +15,7 @@ spring.jpa.properties.hibernate.connection.useUnicode=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=update
jwt.secret = mySecretKey123456789012345678901234567890
jwt.secret = D1kD4fP8wQ2zL6hM9sR3vX7yU0tJ5nB2cV8pG4qW6eY1iK3oA9uH7jN2mZ5xT9bS4rF0lP3dQ8wE1
jwt.expiration = 86400000
jwt.refresh-expiration= 604800000

@ -15,7 +15,7 @@ spring.jpa.properties.hibernate.connection.useUnicode=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=update
jwt.secret = mySecretKey123456789012345678901234567890
jwt.secret = D1kD4fP8wQ2zL6hM9sR3vX7yU0tJ5nB2cV8pG4qW6eY1iK3oA9uH7jN2mZ5xT9bS4rF0lP3dQ8wE1
jwt.expiration = 86400000
jwt.refresh-expiration= 604800000

Loading…
Cancel
Save