Browse Source

Authentication and authorization process modified and completed

master
arjundhami123 8 months ago
parent
commit
250ec71005
  1. 58
      DB/SP's/PROC_REMIT_INBOUND_LOGIN.sql
  2. 7
      DB/SP's/PROC_REMIT_INBOUND_LOGS.sql
  3. 9
      DB/Tables/Log_Session_Tables.sql
  4. 103
      PostmanCollection/RemitInbound.postman_collection.json
  5. BIN
      RemitInboundAPI/.vs/ProjectEvaluation/remitinboundapi.metadata.v7.bin
  6. BIN
      RemitInboundAPI/.vs/ProjectEvaluation/remitinboundapi.projects.v7.bin
  7. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/DesignTimeBuild/.dtbcache.v2
  8. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/7d68c3a1-f452-4b79-9f87-49d494d8579b.vsidx
  9. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/976e1bb5-25d3-4f6c-943c-67a0178fdc60.vsidx
  10. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/b13aa5e3-d976-4365-9ff8-bdfb185030ee.vsidx
  11. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/e1f862d2-4639-43f7-a8c7-8637769e6ce4.vsidx
  12. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/v17/.futdcache.v2
  13. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/v17/.suo
  14. 34
      RemitInboundAPI/RemitInboundAPI.Business/Business/ApplicationBusiness/ApplicationBusiness.cs
  15. 1
      RemitInboundAPI/RemitInboundAPI.Business/Business/ApplicationBusiness/IApplicationBusiness.cs
  16. 2
      RemitInboundAPI/RemitInboundAPI.Business/Business/RemitBusiness/RemitBusiness.cs
  17. BIN
      RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Business.dll
  18. BIN
      RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Business.pdb
  19. BIN
      RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Common.dll
  20. BIN
      RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Common.pdb
  21. BIN
      RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Repository.dll
  22. BIN
      RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Repository.pdb
  23. 2
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.AssemblyInfo.cs
  24. 2
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.AssemblyInfoInputs.cache
  25. BIN
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.csproj.AssemblyReference.cache
  26. BIN
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.dll
  27. BIN
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.pdb
  28. BIN
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/ref/RemitInboundAPI.Business.dll
  29. BIN
      RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/refint/RemitInboundAPI.Business.dll
  30. 3
      RemitInboundAPI/RemitInboundAPI.Business/obj/RemitInboundAPI.Business.csproj.nuget.dgspec.json
  31. 1
      RemitInboundAPI/RemitInboundAPI.Business/obj/project.assets.json
  32. 2
      RemitInboundAPI/RemitInboundAPI.Business/obj/project.nuget.cache
  33. 12
      RemitInboundAPI/RemitInboundAPI.Common/Model/ApplicationModel/AuthenticateModel.cs
  34. BIN
      RemitInboundAPI/RemitInboundAPI.Common/bin/Debug/net8.0/RemitInboundAPI.Common.dll
  35. BIN
      RemitInboundAPI/RemitInboundAPI.Common/bin/Debug/net8.0/RemitInboundAPI.Common.pdb
  36. 2
      RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.AssemblyInfo.cs
  37. 2
      RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.AssemblyInfoInputs.cache
  38. BIN
      RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.dll
  39. BIN
      RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.pdb
  40. BIN
      RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/ref/RemitInboundAPI.Common.dll
  41. BIN
      RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/refint/RemitInboundAPI.Common.dll
  42. 1
      RemitInboundAPI/RemitInboundAPI.Common/obj/RemitInboundAPI.Common.csproj.nuget.dgspec.json
  43. 1
      RemitInboundAPI/RemitInboundAPI.Common/obj/project.assets.json
  44. 2
      RemitInboundAPI/RemitInboundAPI.Common/obj/project.nuget.cache
  45. 28
      RemitInboundAPI/RemitInboundAPI.Repository/Repository/ApplicationRepository/ApplicationRepository.cs
  46. 1
      RemitInboundAPI/RemitInboundAPI.Repository/Repository/ApplicationRepository/IApplicationRepository.cs
  47. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Common.dll
  48. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Common.pdb
  49. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Repository.dll
  50. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Repository.pdb
  51. 2
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.AssemblyInfo.cs
  52. 2
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.AssemblyInfoInputs.cache
  53. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.csproj.AssemblyReference.cache
  54. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.dll
  55. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.pdb
  56. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/ref/RemitInboundAPI.Repository.dll
  57. BIN
      RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/refint/RemitInboundAPI.Repository.dll
  58. 2
      RemitInboundAPI/RemitInboundAPI.Repository/obj/RemitInboundAPI.Repository.csproj.nuget.dgspec.json
  59. 1
      RemitInboundAPI/RemitInboundAPI.Repository/obj/project.assets.json
  60. 2
      RemitInboundAPI/RemitInboundAPI.Repository/obj/project.nuget.cache
  61. 22
      RemitInboundAPI/RemitInboundAPI/Authorization/AuthorizationAttribute.cs
  62. 8
      RemitInboundAPI/RemitInboundAPI/Authorization/AuthorizationHelper.cs
  63. 6
      RemitInboundAPI/RemitInboundAPI/Controllers/ApplicationController.cs
  64. 10
      RemitInboundAPI/RemitInboundAPI/Controllers/RemitController.cs
  65. 10
      RemitInboundAPI/RemitInboundAPI/appsettings.json
  66. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Business.dll
  67. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Business.pdb
  68. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Common.dll
  69. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Common.pdb
  70. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Repository.dll
  71. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Repository.pdb
  72. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.dll
  73. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.exe
  74. BIN
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.pdb
  75. 10
      RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/appsettings.json
  76. 2
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.AssemblyInfo.cs
  77. 2
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.AssemblyInfoInputs.cache
  78. BIN
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.csproj.AssemblyReference.cache
  79. BIN
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.dll
  80. BIN
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.pdb
  81. BIN
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/apphost.exe
  82. BIN
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/ref/RemitInboundAPI.dll
  83. BIN
      RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/refint/RemitInboundAPI.dll
  84. 4
      RemitInboundAPI/RemitInboundAPI/obj/RemitInboundAPI.csproj.nuget.dgspec.json
  85. 1
      RemitInboundAPI/RemitInboundAPI/obj/project.assets.json
  86. 2
      RemitInboundAPI/RemitInboundAPI/obj/project.nuget.cache
  87. BIN
      TestAppRemitInbound/.vs/TestAppRemitInbound/v17/.suo
  88. BIN
      TestAppRemitInbound/TestAppRemitInbound/bin/Debug/TestAppRemitInbound.exe
  89. BIN
      TestAppRemitInbound/TestAppRemitInbound/bin/Debug/TestAppRemitInbound.pdb
  90. BIN
      TestAppRemitInbound/TestAppRemitInbound/obj/Debug/TestAppRemitInbound.exe
  91. BIN
      TestAppRemitInbound/TestAppRemitInbound/obj/Debug/TestAppRemitInbound.pdb
  92. BIN
      TestBlazorApp/.vs/ProjectEvaluation/testblazorapp.metadata.v7.bin
  93. BIN
      TestBlazorApp/.vs/ProjectEvaluation/testblazorapp.projects.v7.bin
  94. BIN
      TestBlazorApp/.vs/TestBlazorApp/DesignTimeBuild/.dtbcache.v2
  95. BIN
      TestBlazorApp/.vs/TestBlazorApp/FileContentIndex/38db036c-3760-48a2-91b8-5a8a52ea277a.vsidx
  96. 1021
      TestBlazorApp/.vs/TestBlazorApp/config/applicationhost.config
  97. BIN
      TestBlazorApp/.vs/TestBlazorApp/v17/.futdcache.v2
  98. BIN
      TestBlazorApp/.vs/TestBlazorApp/v17/.suo
  99. 25
      TestBlazorApp/TestBlazorApp.sln
  100. 113
      TestBlazorApp/TestBlazorApp/Components/Account/IdentityComponentsEndpointRouteBuilderExtensions.cs

58
DB/SP's/PROC_REMIT_INBOUND_LOGIN.sql

@ -7,7 +7,7 @@ ALTER PROC PROC_REMIT_INBOUND_LOGIN
, @Password VARCHAR(120) = NULL
, @AgentId INT = NULL
, @IpAddress VARCHAR(20) = NULL
, @SessionId VARCHAR(40) = NULL
, @SessionIdentifier VARCHAR(40) = NULL
, @ExpiresIn INT = NULL
)
AS;
@ -124,18 +124,62 @@ BEGIN TRY
UPDATE TBL_USER_SESSION SET IsExpired = 1 WHERE UserId = @userId
DECLARE @ProcessIdentifier VARCHAR(40)
SET @ProcessIdentifier = NEWID()
INSERT INTO TBL_USER_SESSION(UserId, SessionIdentifier, IpAddress, ExpiryDate)
SELECT @userId, @SessionIdentifier, @IpAddress, DATEADD(MINUTE, @ExpiresIn, GETDATE())
INSERT INTO TBL_USER_SESSION(UserId, SessionId, ProcessIdentifier, IpAddress, ExpiryDate)
SELECT @userId, @SessionId, @ProcessIdentifier, @IpAddress, DATEADD(MINUTE, @ExpiresIn, GETDATE())
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 100, @ErrorMessage = 'Success.', @Id = @userId, @Extra = @ProcessIdentifier;
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 100, @ErrorMessage = 'Success.', @Id = @userId, @Extra = NULL;
END
ELSE IF @Flag = 'APPID'
BEGIN
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 100, @ErrorMessage = 'Success.', @Id = 'c3a09a0c-dd5b-4d84-acf2-81d613f2f3cb', @Extra = 'JjR7GCf5TuMmUMUI780Y2UCu+Hc1rnW7gp9eb3S+n3E=';
END
ELSE IF @Flag = 'CHECK-AUTH'
BEGIN
SELECT
@UserId = userId
,@UserActive = ISNULL(au.isActive, 'N')
,@LoginUserAgtId = au.agentId
,@EmpId = employeeId
,@IsLocked = ISNULL(isLocked, 'N')
,@AgentActiveStatus = ISNULL(am.isActive, 'N')
FROM applicationUsers au WITH(NOLOCK)
INNER JOIN agentMaster am WITH(NOLOCK) ON au.agentId = am.agentId
WHERE userName = @UserName and ISNULL(au.isDeleted, 'N') = 'N'
IF @UserId IS NULL
BEGIN
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 101, @ErrorMessage = 'Login fails, Incorrect user name or password.', @Id = NULL;
RETURN;
END
IF @UserActive = 'N'
BEGIN
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 101, @ErrorMessage = 'User is not active.', @Id = NULL;
RETURN;
END
IF @AgentActiveStatus = 'N'
BEGIN
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 101, @ErrorMessage = 'Your account is blocked.', @Id = NULL;
RETURN;
END
IF (@AgentId <> ISNULL(@LoginUserAgtId, -1))
BEGIN
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 101, @ErrorMessage = 'Invalid Agent Id.', @Id = NULL;
RETURN;
END
IF(@isLocked = 'Y')
BEGIN
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 101, @ErrorMessage = 'Your account has been locked. Please, contact your administrator.', @Id = NULL;
RETURN;
END
IF NOT EXISTS(SELECT 'X' FROM TBL_USER_SESSION (NOLOCK) WHERE UserId = @UserId AND IsExpired = 0 AND SessionIdentifier = @SessionIdentifier)
BEGIN
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 101, @ErrorMessage = 'Invalid or inactive Session.', @Id = NULL;
RETURN;
END
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 100, @ErrorMessage = 'Success.', @Id = @userId, @Extra = NULL;
END
END TRY
BEGIN CATCH
IF @@TRANCOUNT>0

7
DB/SP's/PROC_REMIT_INBOUND_LOGS.sql

@ -3,7 +3,8 @@
ALTER PROC PROC_REMIT_INBOUND_LOGS
(
@Flag VARCHAR(20)
, @SessionId VARCHAR(40) = NULL
, @SessionIdentifier VARCHAR(40) = NULL
, @ProcessIdentifier VARCHAR(40) = NULL
, @RequestedBy VARCHAR(80) = NULL
, @MethodName VARCHAR(50) = NULL
, @IpAddress VARCHAR(20) = NULL
@ -21,8 +22,8 @@ BEGIN TRY
DECLARE @ErrorMsg VARCHAR(MAX) = NULL
IF @Flag = 'I-LOG'
BEGIN
INSERT INTO TBL_REMIT_INBOUND_LOG (SessionId, RequestedBy, RequestedDate, MethodName, PartnerSessionId, RequestJson, IpAddress)
SELECT @SessionId, @RequestedBy, GETDATE(), @MethodName, @PartnerSessionId, @RequestJson, @IpAddress
INSERT INTO TBL_REMIT_INBOUND_LOG (SessionIdentifier, ProcessIdentifier, RequestedBy, RequestedDate, MethodName, PartnerSessionId, RequestJson, IpAddress)
SELECT @SessionIdentifier, @ProcessIdentifier, @RequestedBy, GETDATE(), @MethodName, @PartnerSessionId, @RequestJson, @IpAddress
SET @RowId = @@IDENTITY;
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 100, @ErrorMessage = 'Success saving inbound log.', @Id = @RowId;

9
DB/Tables/Log_Session_Tables.sql

@ -4,7 +4,8 @@
CREATE TABLE TBL_REMIT_INBOUND_LOG
(
RowId BIGINT NOT NULL IDENTITY(1, 1) PRIMARY KEY
, SessionId VARCHAR(40) NULL
, SessionIdentifier VARCHAR(40) NULL
, ProcessIdentifier VARCHAR(40) NULL
, RequestedBy VARCHAR(80) NOT NULL
, RequestedDate DATETIME DEFAULT(GETDATE()) NOT NULL
, MethodName VARCHAR(50) NOT NULL
@ -19,8 +20,7 @@ CREATE TABLE TBL_USER_SESSION
(
RowId BIGINT NOT NULL IDENTITY(1, 1)
, UserId INT NOT NULL
, SessionId VARCHAR(40) NOT NULL
, ProcessIdentifier VARCHAR(40) NOT NULL
, SessionIdentifier VARCHAR(40) NOT NULL
, IpAddress VARCHAR(20) NOT NULL
, CreatedDate DATETIME DEFAULT(GETDATE()) NOT NULL
, ExpiryDate DATETIME NOT NULL
@ -35,6 +35,9 @@ SELECT GETDATE()
SELECT * FROM TBL_REMIT_INBOUND_LOG
SELECT * FROM TBL_USER_SESSION
select * from logdb.dbo.TBL_REMIT_INBOUND_LOG where processidentifier='880dd244-1709-46a0-8499-6d6631d88bed'
EXEC PROC_REMIT_INBOUND_LOGS @Flag = 'U-LOG' @ResponseCode= '101', @ResponseMessage = 'Password can not be empty.', @RowId = '4'

103
PostmanCollection/RemitInbound.postman_collection.json

@ -0,0 +1,103 @@
{
"info": {
"_postman_id": "8de745a5-7ded-44b6-b857-e32a3c6e09a2",
"name": "RemitInbound",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json",
"_exporter_id": "2163549"
},
"item": [
{
"name": "Authenticate",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "basic",
"basic": {
"password": "nepal1234",
"username": "ajey",
"saveHelperData": true,
"showPassword": false
}
},
"method": "GET",
"header": [
{
"key": "AgentId",
"value": "394390",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "https://localhost:7026/api/v1/Application/authenticate"
},
"response": []
},
{
"name": "Ping",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "bearer",
"bearer": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VyTmFtZSI6ImFkbWluIiwiQWdlbnRJZCI6IjEwMDEiLCJQcm9jZXNzSWRlbnRpZmllciI6IjVBNzkyRkRDLUI5RDktNDBFQi04NzAwLUYwRjlCOTc5Q0YzMiIsIlNlc3Npb25JZGVudGlmaWVyIjoiNDhkZTdhZTYtNGFiMC00ZjIwLWIxNDEtYzUzZDdiNDJmN2NjIiwiZXhwIjoxNzA2NTE0OTkxLCJpc3MiOiJJTTNVayIsImF1ZCI6IiFNM1VuMXQzREshbkdkMG1VJDNScyJ9.yBRhJEGyEUBv6kX6aEE1Xl1EIB5rkwHzW3Vhe2MSILc"
}
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"agentId\": \"\",\r\n \"userName\": \"\",\r\n \"password\": \"japan@12345\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "https://localhost:7026/api/v1/Application/ping"
},
"response": []
},
{
"name": "ExRate",
"request": {
"auth": {
"type": "bearer",
"bearer": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VyTmFtZSI6ImFqZXkiLCJBZ2VudElkIjoiMzk0MzkwIiwiU2Vzc2lvbklkZW50aWZpZXIiOiI4ZTcwMTE5Ny0yNGE4LTRjMzktOTczZC1lNWI2YWMyN2E5MjEiLCJleHAiOjE3MDczMjM0NDcsImlzcyI6IklNM1VrIiwiYXVkIjoiIU0zVW4xdDNESyFuR2QwbVUkM1JzIn0.DtODcRKkf-RSfxnY7FonBHu3D3cqZXmmCfM9dDDT06o"
}
},
"method": "POST",
"header": [
{
"key": "Signature",
"value": "hmacauth c3a09a0c-dd5b-4d84-acf2-81d613f2f3cb:dK2QcxN0HLhBKJGRpd7d7Zc05ckauaV/xqXxKU8hU8c=:5fe63882ef7642828cedc5b8abd48e60:1706634186",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"partnerSessionId\": \"PARTNER-XXX-SESSION-ID1\",\r\n \"sendingCountryCode\": \"JP\",\r\n \"sendingCurrencyCode\": \"JPY\",\r\n \"payoutCountryCode\": \"NP\",\r\n \"payoutCurrencyCode\": \"NPR\",\r\n \"collectionAmount\": \"500000\",\r\n \"payoutAmount\": \"0\",\r\n \"paymentTypeCode\": \"CP\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "https://localhost:7026/api/v1/Remit/calculateExRate"
},
"response": []
}
]
}

BIN
RemitInboundAPI/.vs/ProjectEvaluation/remitinboundapi.metadata.v7.bin

BIN
RemitInboundAPI/.vs/ProjectEvaluation/remitinboundapi.projects.v7.bin

BIN
RemitInboundAPI/.vs/RemitInboundAPI/DesignTimeBuild/.dtbcache.v2

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/7d68c3a1-f452-4b79-9f87-49d494d8579b.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/976e1bb5-25d3-4f6c-943c-67a0178fdc60.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/b13aa5e3-d976-4365-9ff8-bdfb185030ee.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/e1f862d2-4639-43f7-a8c7-8637769e6ce4.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/v17/.futdcache.v2

BIN
RemitInboundAPI/.vs/RemitInboundAPI/v17/.suo

34
RemitInboundAPI/RemitInboundAPI.Business/Business/ApplicationBusiness/ApplicationBusiness.cs

@ -28,10 +28,34 @@ namespace RemitInboundAPI.Business.Business.ApplicationBusiness
return await _applicationRepo.GetPartnerAuthorizationKeys(agentId);
}
public async Task<CommonResponse> CheckUserAuthentication(AuthenticateModel model)
{
CommonResponse _response;
if (string.IsNullOrEmpty(model.UserName))
{
_response = new CommonResponse(ResponseHelper.FAILED, "Username can not be empty.");
_logger.LogError("APPLICATIONBUSINESS | CHECKUSERAUTHENTICATION | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
}
else if (string.IsNullOrEmpty(model.SessionIdentifier))
{
_response = new CommonResponse(ResponseHelper.FAILED, "SessionIdentifier can not be empty.");
_logger.LogError("APPLICATIONBUSINESS | CHECKUSERAUTHENTICATION | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
}
else if (string.IsNullOrEmpty(model.AgentId))
{
_response = new CommonResponse(ResponseHelper.FAILED, "AgentId can not be empty.");
_logger.LogError("APPLICATIONBUSINESS | CHECKUSERAUTHENTICATION | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
}
else
_response = await _applicationRepo.CheckUserAuthentication(model);
return _response;
}
public async Task<CommonResponse> Authenticate(AuthenticateModel model)
{
CommonResponse _response;
var _logRequestModel = new InboundLogModel(model.SessionId, model.UserName, "Authenticate", model.IpAddress, "", JsonConvert.SerializeObject(model));
var _logRequestModel = new InboundLogModel(model.SessionIdentifier, model.ProcessIdentifier, model.UserName, "Authenticate", model.IpAddress, "", JsonConvert.SerializeObject(model));
var _logResponse = await _applicationRepo.LogInboundData(_logRequestModel);
if (_logResponse.ResponseCode == ResponseHelper.SUCCESS)
@ -39,17 +63,17 @@ namespace RemitInboundAPI.Business.Business.ApplicationBusiness
if (string.IsNullOrEmpty(model.UserName))
{
_response = new CommonResponse(ResponseHelper.FAILED, "Username can not be empty.");
_logger.LogError("APPLICATIONREPOSITORY | APPLICATIONBUSINESS | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
_logger.LogError("APPLICATIONBUSINESS | AUTHENTICATE | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
}
else if (string.IsNullOrEmpty(model.Password))
{
_response = new CommonResponse(ResponseHelper.FAILED, "Password can not be empty.");
_logger.LogError("APPLICATIONREPOSITORY | APPLICATIONBUSINESS | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
_logger.LogError("APPLICATIONBUSINESS | AUTHENTICATE | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
}
else if (string.IsNullOrEmpty(model.AgentId))
{
_response = new CommonResponse(ResponseHelper.FAILED, "AgentId can not be empty.");
_logger.LogError("APPLICATIONREPOSITORY | APPLICATIONBUSINESS | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
_logger.LogError("APPLICATIONBUSINESS | AUTHENTICATE | VALIDATION ERROR | " + JsonConvert.SerializeObject(_response));
}
else
_response = await _applicationRepo.Authenticate(model);
@ -59,7 +83,7 @@ namespace RemitInboundAPI.Business.Business.ApplicationBusiness
else
{
_response = new CommonResponse(ResponseHelper.FAILED, "Error occured in application, please contact Administrator.");
_logger.LogError("APPLICATIONREPOSITORY | APPLICATIONBUSINESS | LOGGING ERROR | " + JsonConvert.SerializeObject(new CommonResponse(ResponseHelper.FAILED, "Error logging Inbound master log.")));
_logger.LogError("APPLICATIONBUSINESS | AUTHENTICATE | LOGGING ERROR | " + JsonConvert.SerializeObject(new CommonResponse(ResponseHelper.FAILED, "Error logging Inbound master log.")));
}
return _response;

1
RemitInboundAPI/RemitInboundAPI.Business/Business/ApplicationBusiness/IApplicationBusiness.cs

@ -7,6 +7,7 @@ namespace RemitInboundAPI.Business.Business.ApplicationBusiness
{
Task<CommonResponse> Authenticate(AuthenticateModel model);
Task<CommonResponse> AuthenticateUser(AuthenticateModel model);
Task<CommonResponse> CheckUserAuthentication(AuthenticateModel model);
Task<PartnerAuthorizationKeys> GetPartnerAuthorizationKeys(string? agentId);
}
}

2
RemitInboundAPI/RemitInboundAPI.Business/Business/RemitBusiness/RemitBusiness.cs

@ -25,7 +25,7 @@ namespace RemitInboundAPI.Business.Business.RemitBusiness
public async Task<CommonResponse> CalculateExRate(ExRateModel model, UserLoginModel loginDetails)
{
CommonResponse _response;
var _logRequestModel = new InboundLogModel(model.SessionId, loginDetails.UserName, "CalculateExRate", model.IpAddress, model.PartnerSessionId, JsonConvert.SerializeObject(model));
var _logRequestModel = new InboundLogModel(model.SessionIdentifier, model.ProcessIdentifier, loginDetails.UserName, "CalculateExRate", model.IpAddress, model.PartnerSessionId, JsonConvert.SerializeObject(model));
var _logResponse = await _applicationRepo.LogInboundData(_logRequestModel);
if (_logResponse.ResponseCode == ResponseHelper.SUCCESS)

BIN
RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Business.dll

BIN
RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Business.pdb

BIN
RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Common.dll

BIN
RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Common.pdb

BIN
RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Repository.dll

BIN
RemitInboundAPI/RemitInboundAPI.Business/bin/Debug/net8.0/RemitInboundAPI.Repository.pdb

2
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.AssemblyInfo.cs

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RemitInboundAPI.Business")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c2a210b9428c77cb4d5720ccdb706388ffc11174")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9ad7ef8499d593f08bb13a035c06a42e1abe368d")]
[assembly: System.Reflection.AssemblyProductAttribute("RemitInboundAPI.Business")]
[assembly: System.Reflection.AssemblyTitleAttribute("RemitInboundAPI.Business")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

2
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.AssemblyInfoInputs.cache

@ -1 +1 @@
ba528559d211e9f5734ebb79af8fd0f41ab158fe8a9d0f0e1cb350e973f42b89
2647352fce26aa5701f15893cd605ecb1b0b577dbf91af58a6ba94eb28451674

BIN
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.csproj.AssemblyReference.cache

BIN
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.dll

BIN
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/RemitInboundAPI.Business.pdb

BIN
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/ref/RemitInboundAPI.Business.dll

BIN
RemitInboundAPI/RemitInboundAPI.Business/obj/Debug/net8.0/refint/RemitInboundAPI.Business.dll

3
RemitInboundAPI/RemitInboundAPI.Business/obj/RemitInboundAPI.Business.csproj.nuget.dgspec.json

@ -27,6 +27,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@ -100,6 +101,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@ -170,6 +172,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {

1
RemitInboundAPI/RemitInboundAPI.Business/obj/project.assets.json

@ -908,6 +908,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {

2
RemitInboundAPI/RemitInboundAPI.Business/obj/project.nuget.cache

@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "2DyjH0jX+xp3y04TrLBOORbha1Z3Vlm+EYutVY8MNPvYU1iQ+nd05P6tA7Cdynvk8TmopqlAbnQjEFgF+YKJ5A==",
"dgSpecHash": "qyx25GSQwPxvA9k54NrFKCawOMVp/iO4amtAbubTldLXEPvcbe7Bz50D0UMXiBa2P0+EIKwDwAx7kbvPLHJ7Qg==",
"success": true,
"projectFilePath": "D:\\C# Projects\\UAT\\JME_JAPAN\\JME_Remit_UAT\\JME Japan\\INBOUND_SEND_API\\RemitInboundAPI\\RemitInboundAPI.Business\\RemitInboundAPI.Business.csproj",
"expectedPackageFiles": [

12
RemitInboundAPI/RemitInboundAPI.Common/Model/ApplicationModel/AuthenticateModel.cs

@ -11,7 +11,6 @@
{
public string? AgentId { get; set; }
public string? UserName { get; set; }
public string? ProcessIdentifier { get; set; }
}
public class PartnerAuthorizationKeys : CommonResponse
@ -23,14 +22,16 @@
public class CommonRequestModel
{
public string? SessionId { get; set; }
public string? ProcessIdentifier { get; set; }
public string? SessionIdentifier { get; set; }
public string? PartnerSessionId { get; set; }
public string? IpAddress { get; set; }
}
public class InboundLogModel
{
public string? SessionId { get; set; }
public string? SessionIdentifier { get; set; }
public string? ProcessIdentifier { get; set; }
public string? RequestedBy { get; set; }
public string? MethodName { get; set; }
public string? IpAddress { get; set; }
@ -39,9 +40,10 @@
public string? ResponseCode { get; set; }
public string? ResponseMessage { get; set; }
public InboundLogModel(string? sessionId, string? requestedBy, string? methodName, string? ipAddress, string? partnerSessionId, string? requestJson, string? responseCode = null, string? responseMessage = null)
public InboundLogModel(string? sessionIdentifier, string? processIdentifier, string? requestedBy, string? methodName, string? ipAddress, string? partnerSessionId, string? requestJson, string? responseCode = null, string? responseMessage = null)
{
SessionId = sessionId;
ProcessIdentifier = processIdentifier;
SessionIdentifier = sessionIdentifier;
RequestedBy = requestedBy;
MethodName = methodName;
IpAddress = ipAddress;

BIN
RemitInboundAPI/RemitInboundAPI.Common/bin/Debug/net8.0/RemitInboundAPI.Common.dll

BIN
RemitInboundAPI/RemitInboundAPI.Common/bin/Debug/net8.0/RemitInboundAPI.Common.pdb

2
RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.AssemblyInfo.cs

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RemitInboundAPI.Common")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c2a210b9428c77cb4d5720ccdb706388ffc11174")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9ad7ef8499d593f08bb13a035c06a42e1abe368d")]
[assembly: System.Reflection.AssemblyProductAttribute("RemitInboundAPI.Common")]
[assembly: System.Reflection.AssemblyTitleAttribute("RemitInboundAPI.Common")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

2
RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.AssemblyInfoInputs.cache

@ -1 +1 @@
d5da053cd5c9a58e639e0d7669728665e1f50ad0c758c19e72ca199d38d69e4b
75b3b37e505710e6cff3d6fd97a38a745494bf435fd176cf3ceadbe99fcb9eed

BIN
RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.dll

BIN
RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/RemitInboundAPI.Common.pdb

BIN
RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/ref/RemitInboundAPI.Common.dll

BIN
RemitInboundAPI/RemitInboundAPI.Common/obj/Debug/net8.0/refint/RemitInboundAPI.Common.dll

1
RemitInboundAPI/RemitInboundAPI.Common/obj/RemitInboundAPI.Common.csproj.nuget.dgspec.json

@ -27,6 +27,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {

1
RemitInboundAPI/RemitInboundAPI.Common/obj/project.assets.json

@ -226,6 +226,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {

2
RemitInboundAPI/RemitInboundAPI.Common/obj/project.nuget.cache

@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "QMtyQ6GVMF5dW+fHVzqvAbsyTJ/ze2C/aEp8hDUD0mTtEwwCuNMaER74Tz8jYLQ5zFGGyuBME+oJDYzZemflYw==",
"dgSpecHash": "q3AVvr1TWOL2eQcR//7uhW252T9AotoH6gtFqIOq1MNR+mM9mjobg6EWPhDG3voNBRfN1U9MngamEurkCU7vNA==",
"success": true,
"projectFilePath": "D:\\C# Projects\\UAT\\JME_JAPAN\\JME_Remit_UAT\\JME Japan\\INBOUND_SEND_API\\RemitInboundAPI\\RemitInboundAPI.Common\\RemitInboundAPI.Common.csproj",
"expectedPackageFiles": [

28
RemitInboundAPI/RemitInboundAPI.Repository/Repository/ApplicationRepository/ApplicationRepository.cs

@ -50,7 +50,7 @@ namespace RemitInboundAPI.Repository.Repository.ApplicationRepository
sql += ", @UserName= " + _connHelper.FilterString(model.UserName);
sql += ", @Password = " + _connHelper.FilterString(model.Password);
sql += ", @AgentId = " + _connHelper.FilterString(model.AgentId);
sql += ", @SessionId = " + _connHelper.FilterString(model.SessionId);
sql += ", @SessionIdentifier = " + _connHelper.FilterString(model.SessionIdentifier);
sql += ", @IpAddress = " + _connHelper.FilterString(model.IpAddress);
sql += ", @ExpiresIn = " + _connHelper.FilterString(Utilities.ReadAppSettings("JWT:ExpiryTimeInMinutes"));
@ -73,7 +73,8 @@ namespace RemitInboundAPI.Repository.Repository.ApplicationRepository
try
{
var sql = "EXEC PROC_REMIT_INBOUND_LOGS @Flag = 'I-LOG'";
sql += ", @SessionId = " + _connHelper.FilterString(model.SessionId);
sql += ", @SessionIdentifier = " + _connHelper.FilterString(model.SessionIdentifier);
sql += ", @ProcessIdentifier = " + _connHelper.FilterString(model.ProcessIdentifier);
sql += ", @RequestedBy = " + _connHelper.FilterString(model.RequestedBy);
sql += ", @MethodName= " + _connHelper.FilterString(model.MethodName);
sql += ", @PartnerSessionId = " + _connHelper.FilterString(model.PartnerSessionId);
@ -145,5 +146,28 @@ namespace RemitInboundAPI.Repository.Repository.ApplicationRepository
}
return await Task.FromResult(_response);
}
public async Task<CommonResponse> CheckUserAuthentication(AuthenticateModel model)
{
var _response = new CommonResponse();
try
{
var sql = "EXEC PROC_REMIT_INBOUND_LOGIN @Flag = 'CHECK-AUTH'";
sql += ", @UserName = " + _connHelper.FilterString(model.UserName);
sql += ", @AgentId = " + _connHelper.FilterString(model.AgentId);
sql += ", @SessionIdentifier = " + _connHelper.FilterString(model.SessionIdentifier);
_logger.LogDebug("APPLICATIONREPOSITORY | CHECKUSERAUTHENTICATION | SQL | " + sql);
_response = _connHelper.ParseDbResult(sql);
}
catch (Exception ex)
{
_response.ResponseCode = ResponseHelper.EXCEPTION;
_response.ResponseMessage = "Exception occured: " + ex.Message;
_logger.LogError("APPLICATIONREPOSITORY | CHECKUSERAUTHENTICATION | EXCEPTION | " + JsonConvert.SerializeObject(_response));
}
return await Task.FromResult(_response);
}
}
}

1
RemitInboundAPI/RemitInboundAPI.Repository/Repository/ApplicationRepository/IApplicationRepository.cs

@ -10,5 +10,6 @@ namespace RemitInboundAPI.Repository.Repository.ApplicationRepository
Task<CommonResponse> LogInboundData(InboundLogModel model);
Task<CommonResponse> LogUpdateInboundData(CommonResponse response, string rowId);
Task<PartnerAuthorizationKeys> GetPartnerAuthorizationKeys(string? agentId);
Task<CommonResponse> CheckUserAuthentication(AuthenticateModel model);
}
}

BIN
RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Common.dll

BIN
RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Common.pdb

BIN
RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Repository.dll

BIN
RemitInboundAPI/RemitInboundAPI.Repository/bin/Debug/net8.0/RemitInboundAPI.Repository.pdb

2
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.AssemblyInfo.cs

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RemitInboundAPI.Repository")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c2a210b9428c77cb4d5720ccdb706388ffc11174")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9ad7ef8499d593f08bb13a035c06a42e1abe368d")]
[assembly: System.Reflection.AssemblyProductAttribute("RemitInboundAPI.Repository")]
[assembly: System.Reflection.AssemblyTitleAttribute("RemitInboundAPI.Repository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

2
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.AssemblyInfoInputs.cache

@ -1 +1 @@
b18056761abf675404b32ecdc901c17df9815a1a2cc99f605b7c779ee21f699f
4a644bf75667c33a48cba15e1326a62cfedebab6e6ca37cc20952e9dbd69f769

BIN
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.csproj.AssemblyReference.cache

BIN
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.dll

BIN
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/RemitInboundAPI.Repository.pdb

BIN
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/ref/RemitInboundAPI.Repository.dll

BIN
RemitInboundAPI/RemitInboundAPI.Repository/obj/Debug/net8.0/refint/RemitInboundAPI.Repository.dll

2
RemitInboundAPI/RemitInboundAPI.Repository/obj/RemitInboundAPI.Repository.csproj.nuget.dgspec.json

@ -27,6 +27,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@ -97,6 +98,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {

1
RemitInboundAPI/RemitInboundAPI.Repository/obj/project.assets.json

@ -888,6 +888,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {

2
RemitInboundAPI/RemitInboundAPI.Repository/obj/project.nuget.cache

@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "K43yvJtsVfZzRef+fe/86ll2c1ma/6BO27kK1UGfRgIvbLQjpBc9JguAiIKiD7IDzL9YlIjzIVXossTy0FfA3w==",
"dgSpecHash": "Zc8yYY8TW1xlLnGdWaxHaFKMvoIAHw1iunQkJ+e8ISVdbs87mgwHHy8OCJ+yEKVfhaqei8e2zL1IiVnTwvrJ8w==",
"success": true,
"projectFilePath": "D:\\C# Projects\\UAT\\JME_JAPAN\\JME_Remit_UAT\\JME Japan\\INBOUND_SEND_API\\RemitInboundAPI\\RemitInboundAPI.Repository\\RemitInboundAPI.Repository.csproj",
"expectedPackageFiles": [

22
RemitInboundAPI/RemitInboundAPI/Authorization/AuthorizationAttribute.cs

@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Http.Extensions;
using System.Web;
using System.Net.Http.Headers;
using System.Security.Cryptography;
using RemitInboundAPI.Common.Model.ApplicationModel;
namespace RemitInboundAPI.Authorization
{
@ -90,12 +91,25 @@ namespace RemitInboundAPI.Authorization
{
ClaimsPrincipal principal = tokenHandler.ValidateToken(token, validationParameters, out _);
var ticket = new AuthenticationTicket(principal, Scheme.Name);
string agentId = principal.FindFirst("AgentId")?.Value;
string userName = principal.FindFirst("UserName")?.Value;
//check if session is expired or not from db
AuthenticateModel model = new AuthenticateModel();
model.AgentId = principal.FindFirst("AgentId")?.Value;
model.UserName = principal.FindFirst("UserName")?.Value;
model.SessionIdentifier = principal.FindFirst("SessionIdentifier")?.Value;
if (string.IsNullOrEmpty(model.AgentId) || string.IsNullOrEmpty(model.UserName))
{
errorMessages.Add("ErrorMessage", "Invalid Authorization Header!");
return await Task.FromResult(AuthenticateResult.Fail("Invalid Authorization Header!"));
}
//check if user and agent is active
var checkAuthResponse = await _applicationBusiness.CheckUserAuthentication(model);
if (checkAuthResponse.ResponseCode != ResponseHelper.SUCCESS)
{
errorMessages.Add("ErrorMessage", checkAuthResponse.ResponseMessage ?? "Invalid user details!");
return await Task.FromResult(AuthenticateResult.Fail(checkAuthResponse.ResponseMessage ?? "Invalid user details!"));
}
var allowedAppsDb = await _applicationBusiness.GetPartnerAuthorizationKeys(agentId);
var allowedAppsDb = await _applicationBusiness.GetPartnerAuthorizationKeys(model.AgentId);
if (allowedAppsDb.ResponseCode != ResponseHelper.SUCCESS)
{
errorMessages.Add("ErrorMessage", allowedAppsDb.ResponseMessage);

8
RemitInboundAPI/RemitInboundAPI/Authorization/AuthorizationHelper.cs

@ -21,8 +21,7 @@ namespace RemitInboundAPI.Authorization
{
new Claim("UserName", model.UserName),
new Claim("AgentId", model.AgentId),
new Claim("ProcessIdentifier", loginResponse.Extra),
new Claim("SessionIdentifier", model.SessionId)
new Claim("SessionIdentifier", model.SessionIdentifier)
};
var token = new JwtSecurityToken(
@ -40,7 +39,7 @@ namespace RemitInboundAPI.Authorization
TokenType = "Bearer",
ExpiresIn = Convert.ToInt16(Utilities.ReadAppSettings("JWT:ExpiryTimeInMinutes")) * 60,
//ValidTo = TimeZoneInfo.ConvertTimeFromUtc(token.ValidTo, localTimeZone).ToString(),
SessionId = model.SessionId
model.SessionIdentifier
};
loginResponse.Data = tokenResponse;
loginResponse.Id = null;
@ -56,8 +55,7 @@ namespace RemitInboundAPI.Authorization
{
_authModel.AgentId = user.FindFirst("AgentId")?.Value;
_authModel.UserName = user.FindFirst("UserName")?.Value;
_authModel.SessionId = user.FindFirst("SessionIdentifier")?.Value;
_authModel.ProcessIdentifier = user.FindFirst("ProcessIdentifier")?.Value;
_authModel.SessionIdentifier = user.FindFirst("SessionIdentifier")?.Value;
return await Task.FromResult(_authModel);
}

6
RemitInboundAPI/RemitInboundAPI/Controllers/ApplicationController.cs

@ -40,11 +40,13 @@ namespace RemitInboundAPI.Controllers
return Ok(new CommonResponse { ResponseCode = 101, ResponseMessage = "Invalid headers found!" });
var _response = new CommonResponse();
model.SessionId = Convert.ToString(Guid.NewGuid());
model.ProcessIdentifier = Convert.ToString(Guid.NewGuid());
model.SessionIdentifier = Convert.ToString(Guid.NewGuid());
model.IpAddress = Utilities.GetIpAddress(HttpContext);
using (LogContext.PushProperty("PartnerSessionId", model.PartnerSessionId))
using (LogContext.PushProperty("SessionId", model.SessionId))
using (LogContext.PushProperty("ProcessIdentifier", model.ProcessIdentifier))
using (LogContext.PushProperty("SessionIdentifier", model.SessionIdentifier))
{
_logger.LogInformation($"APPLICATIONCONTROLLER | GETCOUNTRYSERVICES | REQUEST | {JsonConvert.SerializeObject(model)}");
_response = await _applicationBusiness.Authenticate(model);

10
RemitInboundAPI/RemitInboundAPI/Controllers/RemitController.cs

@ -3,12 +3,10 @@ using Newtonsoft.Json;
using RemitInboundAPI.Authorization;
using RemitInboundAPI.Business.Business.RemitBusiness;
using RemitInboundAPI.Common.Helper;
using RemitInboundAPI.Common.Model.ApplicationModel;
using RemitInboundAPI.Common.Model;
using Serilog.Context;
using Microsoft.AspNetCore.Authorization;
using RemitInboundAPI.Common.Model.RemitModel;
using System.Security.Claims;
namespace RemitInboundAPI.Controllers
{
@ -31,12 +29,14 @@ namespace RemitInboundAPI.Controllers
public async Task<IActionResult> CalculateExRate(ExRateModel model)
{
var _response = new CommonResponse();
model.SessionId = Convert.ToString(Guid.NewGuid());
model.IpAddress = Utilities.GetIpAddress(HttpContext);
var loginDetails = await AuthorizationHelper.GetLoginDetails(User);
model.SessionIdentifier = loginDetails.SessionIdentifier; //unique for one session
model.ProcessIdentifier = Convert.ToString(Guid.NewGuid()); //unique for each process
model.IpAddress = Utilities.GetIpAddress(HttpContext);
using (LogContext.PushProperty("PartnerSessionId", model.PartnerSessionId))
using (LogContext.PushProperty("SessionId", model.SessionId))
using (LogContext.PushProperty("ProcessIdentifier", model.ProcessIdentifier))
using (LogContext.PushProperty("SessionIdentifier", model.SessionIdentifier))
{
_logger.LogInformation($"APPLICATIONCONTROLLER | CALCULATEEXRATE | REQUEST | {JsonConvert.SerializeObject(model)}");
_response = await _remitBusiness.CalculateExRate(model, loginDetails);

10
RemitInboundAPI/RemitInboundAPI/appsettings.json

@ -20,7 +20,13 @@
"columnOptions": {
"additionalColumns": [
{
"ColumnName": "SessionId",
"ColumnName": "SessionIdentifier",
"DataType": "varchar",
"AllowNull": true,
"DataLength": 50
},
{
"ColumnName": "ProcessIdentifier",
"DataType": "varchar",
"AllowNull": true,
"DataLength": 50
@ -65,5 +71,5 @@
"ValidIssuer": "IM3Uk",
"Secret": "v9FPjwtQVCpMMLOt+zCLPo2Y4Hy5lWgxW8JPxx+Pg6o="
},
"RequestMaxAgeInSeconds": "60"
"RequestMaxAgeInSeconds": "600"
}

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Business.dll

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Business.pdb

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Common.dll

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Common.pdb

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Repository.dll

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.Repository.pdb

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.dll

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.exe

BIN
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/RemitInboundAPI.pdb

10
RemitInboundAPI/RemitInboundAPI/bin/Debug/net8.0/appsettings.json

@ -20,7 +20,13 @@
"columnOptions": {
"additionalColumns": [
{
"ColumnName": "SessionId",
"ColumnName": "SessionIdentifier",
"DataType": "varchar",
"AllowNull": true,
"DataLength": 50
},
{
"ColumnName": "ProcessIdentifier",
"DataType": "varchar",
"AllowNull": true,
"DataLength": 50
@ -65,5 +71,5 @@
"ValidIssuer": "IM3Uk",
"Secret": "v9FPjwtQVCpMMLOt+zCLPo2Y4Hy5lWgxW8JPxx+Pg6o="
},
"RequestMaxAgeInSeconds": "60"
"RequestMaxAgeInSeconds": "600"
}

2
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.AssemblyInfo.cs

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RemitInboundAPI")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c2a210b9428c77cb4d5720ccdb706388ffc11174")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9ad7ef8499d593f08bb13a035c06a42e1abe368d")]
[assembly: System.Reflection.AssemblyProductAttribute("RemitInboundAPI")]
[assembly: System.Reflection.AssemblyTitleAttribute("RemitInboundAPI")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

2
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.AssemblyInfoInputs.cache

@ -1 +1 @@
e773e5fa8d2b878079a4c7def0e07149ac266bca3d9a431f5e52fcf9631630dc
347b3b2896cb7bfc3754504a3c352077fff9350a53dee3a1ab5b22096ad6b630

BIN
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.csproj.AssemblyReference.cache

BIN
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.dll

BIN
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/RemitInboundAPI.pdb

BIN
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/apphost.exe

BIN
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/ref/RemitInboundAPI.dll

BIN
RemitInboundAPI/RemitInboundAPI/obj/Debug/net8.0/refint/RemitInboundAPI.dll

4
RemitInboundAPI/RemitInboundAPI/obj/RemitInboundAPI.csproj.nuget.dgspec.json

@ -27,6 +27,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@ -100,6 +101,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@ -170,6 +172,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
@ -248,6 +251,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {

1
RemitInboundAPI/RemitInboundAPI/obj/project.assets.json

@ -4635,6 +4635,7 @@
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {

2
RemitInboundAPI/RemitInboundAPI/obj/project.nuget.cache

@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "jwOucQL1TeGYHtMeTc3QnAeUQ7gFEVk2ayRxop2BgBYGJlwCnjWAfwDpENv3f6yVNG12HI4pKbD5gqx96u4sVQ==",
"dgSpecHash": "e4D3OitkBlMhr50EAXJufho9Vr6f5iLW1h6llpEzQJ7sfPK2cOZEf7ej8i98IRJmJ1Oq9NHt49mL8Fv9ox9AcA==",
"success": true,
"projectFilePath": "D:\\C# Projects\\UAT\\JME_JAPAN\\JME_Remit_UAT\\JME Japan\\INBOUND_SEND_API\\RemitInboundAPI\\RemitInboundAPI\\RemitInboundAPI.csproj",
"expectedPackageFiles": [

BIN
TestAppRemitInbound/.vs/TestAppRemitInbound/v17/.suo

BIN
TestAppRemitInbound/TestAppRemitInbound/bin/Debug/TestAppRemitInbound.exe

BIN
TestAppRemitInbound/TestAppRemitInbound/bin/Debug/TestAppRemitInbound.pdb

BIN
TestAppRemitInbound/TestAppRemitInbound/obj/Debug/TestAppRemitInbound.exe

BIN
TestAppRemitInbound/TestAppRemitInbound/obj/Debug/TestAppRemitInbound.pdb

BIN
TestBlazorApp/.vs/ProjectEvaluation/testblazorapp.metadata.v7.bin

BIN
TestBlazorApp/.vs/ProjectEvaluation/testblazorapp.projects.v7.bin

BIN
TestBlazorApp/.vs/TestBlazorApp/DesignTimeBuild/.dtbcache.v2

BIN
TestBlazorApp/.vs/TestBlazorApp/FileContentIndex/38db036c-3760-48a2-91b8-5a8a52ea277a.vsidx

1021
TestBlazorApp/.vs/TestBlazorApp/config/applicationhost.config
File diff suppressed because it is too large
View File

BIN
TestBlazorApp/.vs/TestBlazorApp/v17/.futdcache.v2

BIN
TestBlazorApp/.vs/TestBlazorApp/v17/.suo

25
TestBlazorApp/TestBlazorApp.sln

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34330.188
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestBlazorApp", "TestBlazorApp\TestBlazorApp.csproj", "{E971D280-902C-4E61-BEDA-ED0A745D73D7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E971D280-902C-4E61-BEDA-ED0A745D73D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E971D280-902C-4E61-BEDA-ED0A745D73D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E971D280-902C-4E61-BEDA-ED0A745D73D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E971D280-902C-4E61-BEDA-ED0A745D73D7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A68A83B1-DE8D-4EB4-9427-CD254E6C8AD2}
EndGlobalSection
EndGlobal

113
TestBlazorApp/TestBlazorApp/Components/Account/IdentityComponentsEndpointRouteBuilderExtensions.cs

@ -0,0 +1,113 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using System.Security.Claims;
using System.Text.Json;
using TestBlazorApp.Components.Account.Pages;
using TestBlazorApp.Components.Account.Pages.Manage;
using TestBlazorApp.Data;
namespace Microsoft.AspNetCore.Routing
{
internal static class IdentityComponentsEndpointRouteBuilderExtensions
{
// These endpoints are required by the Identity Razor components defined in the /Components/Account/Pages directory of this project.
public static IEndpointConventionBuilder MapAdditionalIdentityEndpoints(this IEndpointRouteBuilder endpoints)
{
ArgumentNullException.ThrowIfNull(endpoints);
var accountGroup = endpoints.MapGroup("/Account");
accountGroup.MapPost("/PerformExternalLogin", (
HttpContext context,
[FromServices] SignInManager<ApplicationUser> signInManager,
[FromForm] string provider,
[FromForm] string returnUrl) =>
{
IEnumerable<KeyValuePair<string, StringValues>> query = [
new("ReturnUrl", returnUrl),
new("Action", ExternalLogin.LoginCallbackAction)];
var redirectUrl = UriHelper.BuildRelative(
context.Request.PathBase,
"/Account/ExternalLogin",
QueryString.Create(query));
var properties = signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl);
return TypedResults.Challenge(properties, [provider]);
});
accountGroup.MapPost("/Logout", async (
ClaimsPrincipal user,
SignInManager<ApplicationUser> signInManager,
[FromForm] string returnUrl) =>
{
await signInManager.SignOutAsync();
return TypedResults.LocalRedirect($"~/{returnUrl}");
});
var manageGroup = accountGroup.MapGroup("/Manage").RequireAuthorization();
manageGroup.MapPost("/LinkExternalLogin", async (
HttpContext context,
[FromServices] SignInManager<ApplicationUser> signInManager,
[FromForm] string provider) =>
{
// Clear the existing external cookie to ensure a clean login process
await context.SignOutAsync(IdentityConstants.ExternalScheme);
var redirectUrl = UriHelper.BuildRelative(
context.Request.PathBase,
"/Account/Manage/ExternalLogins",
QueryString.Create("Action", ExternalLogins.LinkLoginCallbackAction));
var properties = signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, signInManager.UserManager.GetUserId(context.User));
return TypedResults.Challenge(properties, [provider]);
});
var loggerFactory = endpoints.ServiceProvider.GetRequiredService<ILoggerFactory>();
var downloadLogger = loggerFactory.CreateLogger("DownloadPersonalData");
manageGroup.MapPost("/DownloadPersonalData", async (
HttpContext context,
[FromServices] UserManager<ApplicationUser> userManager,
[FromServices] AuthenticationStateProvider authenticationStateProvider) =>
{
var user = await userManager.GetUserAsync(context.User);
if (user is null)
{
return Results.NotFound($"Unable to load user with ID '{userManager.GetUserId(context.User)}'.");
}
var userId = await userManager.GetUserIdAsync(user);
downloadLogger.LogInformation("User with ID '{UserId}' asked for their personal data.", userId);
// Only include personal data for download
var personalData = new Dictionary<string, string>();
var personalDataProps = typeof(ApplicationUser).GetProperties().Where(
prop => Attribute.IsDefined(prop, typeof(PersonalDataAttribute)));
foreach (var p in personalDataProps)
{
personalData.Add(p.Name, p.GetValue(user)?.ToString() ?? "null");
}
var logins = await userManager.GetLoginsAsync(user);
foreach (var l in logins)
{
personalData.Add($"{l.LoginProvider} external login provider key", l.ProviderKey);
}
personalData.Add("Authenticator Key", (await userManager.GetAuthenticatorKeyAsync(user))!);
var fileBytes = JsonSerializer.SerializeToUtf8Bytes(personalData);
context.Response.Headers.TryAdd("Content-Disposition", "attachment; filename=PersonalData.json");
return TypedResults.File(fileBytes, contentType: "application/json", fileDownloadName: "PersonalData.json");
});
return accountGroup;
}
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save