public AuthenticationResponse Login(string username, string password) { string message = String.Empty; try { string encryptedUsername = EncryptionManager.EncryptString(username, Veneka.Indigo.Common.Utilities.StaticFields.USE_HASHING_FOR_ENCRYPTION, Veneka.Indigo.Common.Utilities.StaticFields.EXTERNAL_SECURITY_KEY); string encryptedpwd = EncryptionManager.EncryptString(password, Veneka.Indigo.Common.Utilities.StaticFields.USE_HASHING_FOR_ENCRYPTION, Veneka.Indigo.Common.Utilities.StaticFields.EXTERNAL_SECURITY_KEY); string workstation = EncryptionManager.EncryptString("APILoginAttempt" + DateTime.Now.ToString(), Veneka.Indigo.Common.Utilities.StaticFields.USE_HASHING_FOR_ENCRYPTION, Veneka.Indigo.Common.Utilities.StaticFields.EXTERNAL_SECURITY_KEY); var responseObj = _userManContoller.LogIn(encryptedUsername, encryptedpwd, workstation); if (responseObj.ResponseType == ResponseType.SUCCESSFUL) { string SessionKey = EncryptionManager.DecryptString(responseObj.Value.encryptedSessionKey, Veneka.Indigo.Common.Utilities.StaticFields.USE_HASHING_FOR_ENCRYPTION, Veneka.Indigo.Common.Utilities.StaticFields.EXTERNAL_SECURITY_KEY); string UserId = EncryptionManager.DecryptString(responseObj.Value.encryptedUserId, Veneka.Indigo.Common.Utilities.StaticFields.USE_HASHING_FOR_ENCRYPTION, Veneka.Indigo.Common.Utilities.StaticFields.EXTERNAL_SECURITY_KEY); var token = BackOfficeAPIController.CreateToken(Guid.NewGuid(), SessionKey, int.Parse(UserId), bll.Action.PrintCard); return(new AuthenticationResponse() { ResponseCode = "00", ResponseMessage = "SUCCESSFUL", AuthToken = token }); } } catch (Exception ex) { message = ex.Message; _log.Error(ex); } return(new AuthenticationResponse() { ResponseCode = "01", ResponseMessage = "failed", AuthToken = null }); }