Browse Source

Issue fixes

master
Arjun Dhami 7 months ago
parent
commit
e12781bcaa
  1. 15
      DB/SP's/PROC_REMIT_INBOUND_LOGIN.sql
  2. BIN
      RemitInboundAPI/.vs/ProjectEvaluation/remitinboundapi.metadata.v7.bin
  3. BIN
      RemitInboundAPI/.vs/ProjectEvaluation/remitinboundapi.projects.v7.bin
  4. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/DesignTimeBuild/.dtbcache.v2
  5. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/01239fbf-6687-4b63-998d-f792aca6bc63.vsidx
  6. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/51584667-fac6-4cab-b2bb-5c2a0aa70770.vsidx
  7. BIN
      RemitInboundAPI/.vs/RemitInboundAPI/v17/.suo
  8. 4
      RemitInboundAPI/RemitInboundAPI.Business/Business/ApplicationBusiness/ApplicationBusiness.cs
  9. 2
      RemitInboundAPI/RemitInboundAPI.Business/Business/ApplicationBusiness/IApplicationBusiness.cs
  10. 2
      RemitInboundAPI/RemitInboundAPI.Common/Model/ApplicationModel/AuthenticateModel.cs
  11. 6
      RemitInboundAPI/RemitInboundAPI.Repository/Repository/ApplicationRepository/ApplicationRepository.cs
  12. 2
      RemitInboundAPI/RemitInboundAPI.Repository/Repository/ApplicationRepository/IApplicationRepository.cs
  13. 2
      RemitInboundAPI/RemitInboundAPI/Authorization/AuthorizationAttribute.cs

15
DB/SP's/PROC_REMIT_INBOUND_LOGIN.sql

@ -131,7 +131,20 @@ BEGIN TRY
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=';
DECLARE @AppId VARCHAR(40), @SecretKey VARCHAR(40)
SELECT @AppId = AppId, @SecretKey = APISecretKey
FROM TBL_API_SECRET_KEY AK(NOLOCK)
INNER JOIN applicationUsers AU(NOLOCK) ON AU.userId = AK.UserId
WHERE au.UserName = @UserName
AND Status = 1
IF ISNULL(@AppId, '') = ''
BEGIN
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 101, @ErrorMessage = 'Invalid auth key, contact HO.', @Id = NULL;
RETURN;
END
EXEC SW_PROC_ERROR_HANDLER @ErrorCode = 100, @ErrorMessage = 'Success.', @Id = @AppId, @Extra = @SecretKey;
END
ELSE IF @Flag = 'CHECK-AUTH'
BEGIN

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/01239fbf-6687-4b63-998d-f792aca6bc63.vsidx

BIN
RemitInboundAPI/.vs/RemitInboundAPI/FileContentIndex/51584667-fac6-4cab-b2bb-5c2a0aa70770.vsidx

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

4
RemitInboundAPI/RemitInboundAPI.Business/Business/ApplicationBusiness/ApplicationBusiness.cs

@ -23,9 +23,9 @@ namespace RemitInboundAPI.Business.Business.ApplicationBusiness
return await _applicationRepo.AuthenticateUser(model);
}
public async Task<PartnerAuthorizationKeys> GetPartnerAuthorizationKeys(string? agentId)
public async Task<PartnerAuthorizationKeys> GetPartnerAuthorizationKeys(string? userName)
{
return await _applicationRepo.GetPartnerAuthorizationKeys(agentId);
return await _applicationRepo.GetPartnerAuthorizationKeys(userName);
}
public async Task<CommonResponse> CheckUserAuthentication(AuthenticateModel model)

2
RemitInboundAPI/RemitInboundAPI.Business/Business/ApplicationBusiness/IApplicationBusiness.cs

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

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

@ -15,7 +15,7 @@
public class PartnerAuthorizationKeys : CommonResponse
{
public string? AgentId { get; set; }
public string? UserName { get; set; }
public string? APPId { get; set; }
public string? APISecretKey { get; set; }
}

6
RemitInboundAPI/RemitInboundAPI.Repository/Repository/ApplicationRepository/ApplicationRepository.cs

@ -117,13 +117,13 @@ namespace RemitInboundAPI.Repository.Repository.ApplicationRepository
return _response;
}
public async Task<PartnerAuthorizationKeys> GetPartnerAuthorizationKeys(string? agentId)
public async Task<PartnerAuthorizationKeys> GetPartnerAuthorizationKeys(string? userName)
{
var _response = new PartnerAuthorizationKeys();
try
{
var sql = "EXEC PROC_REMIT_INBOUND_LOGIN @Flag = 'APPID'";
sql += ", @AgentId = " + _connHelper.FilterString(agentId);
sql += ", @UserName = " + _connHelper.FilterString(userName);
_logger.LogDebug("APPLICATIONREPOSITORY | GETPARTNERAUTHORIZATIONKEYS | SQL | " + sql);
var dbRes = _connHelper.ParseDbResult(sql);
@ -132,7 +132,7 @@ namespace RemitInboundAPI.Repository.Repository.ApplicationRepository
_response.ResponseMessage = dbRes.ResponseMessage;
if (dbRes.ResponseCode == ResponseHelper.SUCCESS)
{
_response.AgentId = agentId;
_response.UserName = userName;
_response.APPId = dbRes.Id;
_response.APISecretKey = dbRes.Extra;
}

2
RemitInboundAPI/RemitInboundAPI.Repository/Repository/ApplicationRepository/IApplicationRepository.cs

@ -9,7 +9,7 @@ namespace RemitInboundAPI.Repository.Repository.ApplicationRepository
Task<CommonResponse> AuthenticateUser(AuthenticateModel model);
Task<CommonResponse> LogInboundData(InboundLogModel model);
Task<CommonResponse> LogUpdateInboundData(ApiResponse response, string rowId);
Task<PartnerAuthorizationKeys> GetPartnerAuthorizationKeys(string? agentId);
Task<PartnerAuthorizationKeys> GetPartnerAuthorizationKeys(string? userName);
Task<CommonResponse> CheckUserAuthentication(AuthenticateModel model);
}
}

2
RemitInboundAPI/RemitInboundAPI/Authorization/AuthorizationAttribute.cs

@ -109,7 +109,7 @@ namespace RemitInboundAPI.Authorization
return await Task.FromResult(AuthenticateResult.Fail(checkAuthResponse.ResponseMessage ?? "Invalid user details!"));
}
var allowedAppsDb = await _applicationBusiness.GetPartnerAuthorizationKeys(model.AgentId);
var allowedAppsDb = await _applicationBusiness.GetPartnerAuthorizationKeys(model.UserName);
if (allowedAppsDb.ResponseCode != ResponseHelper.SUCCESS)
{
errorMessages.Add("ErrorMessage", allowedAppsDb.ResponseMessage);

Loading…
Cancel
Save