diff --git a/.vs/AOLBackend/DesignTimeBuild/.dtbcache.v2 b/.vs/AOLBackend/DesignTimeBuild/.dtbcache.v2 index cc1a271..d654e42 100644 Binary files a/.vs/AOLBackend/DesignTimeBuild/.dtbcache.v2 and b/.vs/AOLBackend/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/AOLBackend/v17/.futdcache.v1 b/.vs/AOLBackend/v17/.futdcache.v1 index 36bf145..e29a1e0 100644 Binary files a/.vs/AOLBackend/v17/.futdcache.v1 and b/.vs/AOLBackend/v17/.futdcache.v1 differ diff --git a/.vs/AOLBackend/v17/.suo b/.vs/AOLBackend/v17/.suo index f8c5c57..dd6578d 100644 Binary files a/.vs/AOLBackend/v17/.suo and b/.vs/AOLBackend/v17/.suo differ diff --git a/.vs/ProjectEvaluation/aolbackend.metadata.v2 b/.vs/ProjectEvaluation/aolbackend.metadata.v2 index 5edb00a..9bb44aa 100644 Binary files a/.vs/ProjectEvaluation/aolbackend.metadata.v2 and b/.vs/ProjectEvaluation/aolbackend.metadata.v2 differ diff --git a/.vs/ProjectEvaluation/aolbackend.projects.v2 b/.vs/ProjectEvaluation/aolbackend.projects.v2 index 7e37f8b..0d83d04 100644 Binary files a/.vs/ProjectEvaluation/aolbackend.projects.v2 and b/.vs/ProjectEvaluation/aolbackend.projects.v2 differ diff --git a/AOLBackend.csproj b/AOLBackend.csproj index 3c06bbf..6011aa1 100644 --- a/AOLBackend.csproj +++ b/AOLBackend.csproj @@ -9,6 +9,7 @@ + diff --git a/Contracts/IUsuarioRepository.cs b/Contracts/IUsuarioRepository.cs index c84b133..d12a84b 100644 --- a/Contracts/IUsuarioRepository.cs +++ b/Contracts/IUsuarioRepository.cs @@ -22,5 +22,7 @@ namespace AOLBackend.Contracts public Task> ClonarUsuario(DTOClonarUsuario user); + public Task Activate(int id, int Activo); + } } diff --git a/Controllers/Usuarios/AuthController.cs b/Controllers/Usuarios/AuthController.cs index ac7e0f4..92c564b 100644 --- a/Controllers/Usuarios/AuthController.cs +++ b/Controllers/Usuarios/AuthController.cs @@ -1,11 +1,13 @@ using AOLBackend.Contracts; using AOLBackend.DTO; +using AOLBackend.DTO.Usuario; using AOLBackend.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.IdentityModel.Tokens; using System.IdentityModel.Tokens.Jwt; using System.Security.Claims; +using AOLBackend.Services.EmailSender; using System.Text; // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 @@ -84,5 +86,60 @@ namespace AOLBackend.Controllers.Usuarios { return StatusCode(200, "Its Ok"); } + + [Route("resetPassword")] + [HttpPost] + public async Task ResetPassword(DTOLogin user) + { + try + { + var result = await _usuariosRepo.ResetPassword(user); + if (result == null) + { + return StatusCode(400, "Cuenta de usuario no existe"); + } + var encrypted = AOLBackend.Services.Tools.CryptDecrypt.Encryption(user.Usuario); + EmailSender eSender = new EmailSender(_config); + string htmlContent = $@" + + + + + +
Hola: {user.Usuario}, mediante el siguiente correo electronico, se le notifica que se ha cambiado su contraseña
Para validar que usted cambio su contraseña, favor de dar click al siguiente link
Que tenga un excelente dia!
+ + "; + string resultSendEmail = eSender.SrvSendEmail(htmlContent, "Confirmacion de credenciales de alphaomega.com.mx", user.Usuario); + return Ok(resultSendEmail); + } + catch (Exception ex) + { + return StatusCode(500, ex); + } + } + + [Route("AcceptReset")] + [HttpGet] + public async Task AcceptReset(string key) + { + { + var decrypted = AOLBackend.Services.Tools.CryptDecrypt.Decryption(@key); + try + { + var usuarios = await _usuariosRepo.GetAllUsuariosShort(); + foreach (DTOUsuarioShort usr in usuarios) + { + if (usr.Usuario == decrypted) + { + Boolean result = await _usuariosRepo.Activate(usr.id, 1); + if (result) return Ok("Cuenta activada!"); + else return StatusCode(500, "Ocurrio un error!"); + } + } + } + catch (Exception ex) { return StatusCode(500, ex.Message); } + return StatusCode(200, "Cuenta activada!"); + } + } } } diff --git a/Controllers/Usuarios/UsuariosController.cs b/Controllers/Usuarios/UsuariosController.cs index 760c7ed..bd0ed1c 100644 --- a/Controllers/Usuarios/UsuariosController.cs +++ b/Controllers/Usuarios/UsuariosController.cs @@ -2,7 +2,9 @@ using AOLBackend.DTO; using AOLBackend.DTO.Usuario; using AOLBackend.Models; +using AOLBackend.Services.EmailSender; using Microsoft.AspNetCore.Mvc; +using System.Text; namespace AOLBackend.Controllers.Usuarios { @@ -11,9 +13,13 @@ namespace AOLBackend.Controllers.Usuarios public class UsuariosController : ControllerBase { private readonly IUsuarioRepository _usuariosRepo; - // private readonly IConfiguration _config; + private readonly IConfiguration _config; - public UsuariosController(IUsuarioRepository usuariosRepo, IConfiguration config) { _usuariosRepo = usuariosRepo; } + public UsuariosController(IUsuarioRepository usuariosRepo, IConfiguration config) + { + _usuariosRepo = usuariosRepo; + _config = config; + } [Route("getUsuarioById")] [HttpGet] @@ -52,7 +58,6 @@ namespace AOLBackend.Controllers.Usuarios catch (Exception ex) { return StatusCode(500, ex.Message); } } - [Route("Auth")] [HttpPost] public async Task Auth(DTOLogin user) @@ -65,26 +70,6 @@ namespace AOLBackend.Controllers.Usuarios catch (Exception ex) { return StatusCode(500, ex.Message); } } - - [Route("resetPassword")] - [HttpPost] - public async Task ResetPassword(DTOLogin user) - { - try - { - var result = await _usuariosRepo.ResetPassword(user); - if (result == null) - { - return StatusCode(400, "Cuenta de usuario no existe"); - } - return Ok(result); - } - catch (Exception ex) - { - return StatusCode(500, ex); - } - } - [Route("searchUsuario")] [HttpPost] public async Task SearchUsuario(DTOLogin user) @@ -101,18 +86,33 @@ namespace AOLBackend.Controllers.Usuarios } } - [Route("Append")] [HttpPost] - public async Task POST(IUsuarios user) + public async Task Append(IUsuarios user) { try { var usuario = await _usuariosRepo.CreateUsuario(user); if (user.Id == 0) { - /* Utilerias email = new Utilerias(_config); - Boolean sendOk = email.SendEmail("", usuario);*/ + EmailSender eSender = new EmailSender(_config); + string htmlContent = $@" + + + + + + + + + + + +
Hola: {user.Nombre}, mediante el siguiente correo electronico, se le notifica que se le ha creado un nuevo acceso
Para acceder a su cuenta, favor de entrar a: https://www.alphaomega.com.mx/
Nombre de usuario: {user.Usuario}
Para poder entrar por primera vez, es necesario que establezca su contraseña
Para cambiar/establecer la contraseña, entre a link y de un click al link Olvido contraseña
Si por alguna razon, no recuerda su contrasena, repita este proceso de resetear su contraseña
No es necesario responder a este correo, ya que fue generado en automatico por el sistema.
Nota: Las credenciales de acceso son responsabilidad personal, nadie solo usted debe conocerlas
Que tenga un excelente dia!
+ + "; + string result = eSender.SrvSendEmail(htmlContent, "Confirmacion de credenciales de alphaomega.com.mx", user.Usuario); + return Ok(result); } return Ok(usuario); } @@ -121,7 +121,7 @@ namespace AOLBackend.Controllers.Usuarios [Route("clonarUsuario")] [HttpPost] - public async Task POST(DTOClonarUsuario user) + public async Task clonarUsuario(DTOClonarUsuario user) { try { @@ -130,5 +130,53 @@ namespace AOLBackend.Controllers.Usuarios } catch (Exception ex) { return StatusCode(500, ex.Message); } } + + [Route("SendEmail")] + [HttpGet] + public async Task SendEmail(string Usuario, string Nombre, string Correo) + { + var content = Usuario; + EmailSender eSender = new EmailSender(_config); + string htmlContent = $@" + + + + + + + + + + + +
Hola: {Nombre}, mediante el siguiente correo electronico, se le notifica que se le ha creado un nuevo acceso
Para acceder a su cuenta, favor de entrar a: https://www.alphaomega.com.mx/
Nombre de usuario: {Usuario}
Para poder entrar por primera vez, es necesario que establezca su contraseña
Para cambiar/establecer la contraseña, puede ir al menu Reset, proporcione su nombre de usuario y su nueva contraseña
Si por alguna razon, no recuerda su contrasena, repita este proceso de resetear su contraseña
No es necesario responder a este correo, ya que fue generado en automatico por el sistema.
Nota: Las credenciales de acceso son responsabilidad personal, nadie solo usted debe conocerlas
Que tenga un excelente dia!
+ + "; + string result = eSender.SrvSendEmail(htmlContent, "Confirmacion de credenciales de alphaomega.com.mx", Correo); + return Ok(result); + } + + /* [Route("AcceptReset")] + [HttpGet] + public async Task AcceptReset(string key) + { + var decrypted = AOLBackend.Services.Tools.CryptDecrypt.Decryption(@key); + try + { + // return Ok(decrypted); + var usuarios = await _usuariosRepo.GetAllUsuariosShort(); + foreach (DTOUsuarioShort usr in usuarios) + { + if (usr.Usuario == decrypted) + { + Boolean result = await _usuariosRepo.Activate(usr.id, 1); + if (result) return Ok("Cuenta activada!"); + else return StatusCode(500, "Ocurrio un error!"); + } + } + } + catch (Exception ex) { return StatusCode(500, ex.Message); } + return StatusCode(200, "Cuenta activada!"); + } */ } } diff --git a/DTO/Usuario/DTOUsuarioSendEmail.cs b/DTO/Usuario/DTOUsuarioSendEmail.cs new file mode 100644 index 0000000..a245811 --- /dev/null +++ b/DTO/Usuario/DTOUsuarioSendEmail.cs @@ -0,0 +1,10 @@ +namespace AOLBackend.DTO.Usuario +{ + public class DTOUsuarioSendEmail + { + public string Usuario { get; set; } = null!; + public string Nombre { get; set; } = null!; + public string Correo { get; set; } = null!; + + } +} \ No newline at end of file diff --git a/Repository/UsuariosRepository.cs b/Repository/UsuariosRepository.cs index bfb6a51..4355952 100644 --- a/Repository/UsuariosRepository.cs +++ b/Repository/UsuariosRepository.cs @@ -131,5 +131,20 @@ namespace AOLBackend.Repository return usuario.ToList(); } } + + public async Task Activate(int id, int Activo) + { + var query = "[Usuario.Activate]"; + using (var connection = _context.CreateConnection()) + { + var usuario = await connection.QueryAsync(query, new + { + @id = id, + @Activo = Activo, + }, commandType: CommandType.StoredProcedure); + return true; + } + } + } } diff --git a/Services/EmailSender/EmailSender.cs b/Services/EmailSender/EmailSender.cs index fef392f..e462361 100644 --- a/Services/EmailSender/EmailSender.cs +++ b/Services/EmailSender/EmailSender.cs @@ -1,5 +1,9 @@ -using System.Net; using System.Net.Mail; +using System.Net; +using System; +using System.Collections.Generic; +using System.Text; +using EASendMail; namespace AOLBackend.Services.EmailSender { @@ -11,47 +15,47 @@ namespace AOLBackend.Services.EmailSender { _config = config; } - public Boolean SendEmail(string htmlContent, Usuarios toUser) + public String SrvSendEmail(string htmlContent, string Subject, string toEmail) { - string defaultPassword = _config.GetValue("DefaultUser:Password"); - string emailServer = _config.GetValue("EmailServer"); - int emailPort = _config.GetValue("EmailPort"); - htmlContent = (htmlContent.Length > 0) ? htmlContent : $@" - - - - - - - - - - - - -
Hola: {toUser.Nombre}, mediante el siguiente correo electronico, se le notifica que se le ha creado un nuevo acceso
Para acceder a su cuenta, favor de entrar a: http://reportes.gemcousa.com/
Nombre de usuario: {toUser.Usuario}
Contraseña: {defaultPassword}
Su contraseña inicial sera: {defaultPassword}, pero es necesario que la cambie antes de poder ingresar
Para cambiar la contraseña, puede ir al menu Reset, proporcione su nombre de usuario y su nueva contraseña
Si por alguna razon, no recuerda su contrasena, repita este proceso de resetear su contraseña
No es necesario responder a este correo, ya que fue generado en automatico por el sistema.
Nota: Las credenciales de acceso son responsabilidad personal, nadie solo usted debe conocerlas
Que tenga un excelente dia!
- - "; + string EmailServer = _config.GetValue("EmailServer"); + string EmailAccount = _config.GetValue("EmailAccount"); + string[] Email = EmailAccount.Split('@'); + int EmailPort = Convert.ToInt32(_config.GetValue("EmailPort")); + string EmailPassword = _config.GetValue("EmailPassword"); + string EmailUser = Email[0]; + string EmailDomain = Email[1].Replace("@", ""); + DateTime now = DateTime.Now; try { - using (var smtp = new SmtpClient(emailServer, emailPort)) + using (var smtp = new SmtpClient(EmailServer, EmailPort)) { - smtp.Credentials = new NetworkCredential(_config.GetValue("Email"), _config.GetValue("EmailPassword")); - var correo = new MailMessage(); - correo.From = new MailAddress(_config.GetValue("Email"), "noreply"); - correo.To.Add(toUser.Correo); - correo.Subject = "Notification - Se le ha creado un nuevo acceso en http://reportes.gemcousa.com"; - correo.Body = htmlContent; + smtp.UseDefaultCredentials = false; + smtp.Credentials = new NetworkCredential(EmailAccount, EmailPassword); + smtp.Host = EmailServer; + var correo = new MailMessage(EmailAccount, toEmail); + correo.From = new MailAddress("<" + EmailAccount + ">", "<" + EmailUser + ">"); + correo.Sender = new MailAddress("<" + EmailAccount + ">", "<" + EmailUser + ">"); + correo.Headers.Add("Message-Id", String.Concat("<", now.ToString("yyMMdd"), ".", now.ToString("HHmmss"), "@alphaomega.com.mx>")); + correo.To.Add(toEmail); + correo.Subject = Subject; + correo.Body = "htmlContent"; + correo.BodyEncoding = System.Text.Encoding.UTF8; + correo.SubjectEncoding = System.Text.Encoding.Default; correo.IsBodyHtml = true; smtp.Send(correo); - return true; + return "Message Sent Succesfully"; } } catch (Exception ex) { - //if (ex.Source != null) throw; - return false; + return ex.ToString(); } } + + + public String SrvSendEmail2(string htmlContent, string Subject, string toEmail) + { + return ""; + } } } \ No newline at end of file diff --git a/Services/Tools/CryptDecrypt.cs b/Services/Tools/CryptDecrypt.cs index 406cb71..10e9967 100644 --- a/Services/Tools/CryptDecrypt.cs +++ b/Services/Tools/CryptDecrypt.cs @@ -5,14 +5,15 @@ namespace AOLBackend.Services.Tools { public class CryptDecrypt { - private readonly static string key = "G3mc0H42hk3y2!0$2*2#n4813dc2h47p"; + private readonly static string keyString = "G3mc0H42hk3y2!0$2*2#n4813dc2h47p"; + private readonly static int BlockSize = 128; public static string Encrypt(string text) { byte[] iv = new byte[16]; byte[] array; using (Aes aes = Aes.Create()) { - aes.Key = Encoding.UTF8.GetBytes(key); + aes.Key = Encoding.UTF8.GetBytes(keyString); aes.IV = iv; ICryptoTransform encrypt = aes.CreateEncryptor(aes.Key, aes.IV); using (MemoryStream ms = new MemoryStream()) @@ -36,7 +37,7 @@ namespace AOLBackend.Services.Tools byte[] buffer = Convert.FromBase64String(text); using (Aes aes = Aes.Create()) { - aes.Key = Encoding.UTF8.GetBytes(key); + aes.Key = Encoding.UTF8.GetBytes(keyString); aes.IV = iv; ICryptoTransform decryptor = aes.CreateDecryptor(aes.Key, aes.IV); using (MemoryStream ms = new MemoryStream(buffer)) @@ -51,5 +52,176 @@ namespace AOLBackend.Services.Tools } } } + + /* public static string EncryptString(string text) + { + var key = Encoding.UTF8.GetBytes(keyString); + using (var aesAlg = Aes.Create()) + { + using (var encryptor = aesAlg.CreateEncryptor(key, aesAlg.IV)) + { + using (var msEncrypt = new MemoryStream()) + { + using (var csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write)) + using (var swEncrypt = new StreamWriter(csEncrypt)) { swEncrypt.Write(text); } + var iv = aesAlg.IV; + var decryptedContent = msEncrypt.ToArray(); + var result = new byte[iv.Length + decryptedContent.Length]; + Buffer.BlockCopy(iv, 0, result, 0, iv.Length); + Buffer.BlockCopy(decryptedContent, 0, result, iv.Length, decryptedContent.Length); + msEncrypt.Flush(); + msEncrypt.Close(); + return Convert.ToBase64String(result); + } + } + } + } + + public static string DecryptString(string cipherText) + { + var fullCipher = Convert.FromBase64String(cipherText); + var iv = new byte[16]; + var cipher = new byte[16]; + Buffer.BlockCopy(fullCipher, 0, iv, 0, iv.Length); + Buffer.BlockCopy(fullCipher, iv.Length, cipher, 0, iv.Length); + var key = Encoding.UTF8.GetBytes(keyString); + using (var aesAlg = Aes.Create()) + { + using (var decryptor = aesAlg.CreateDecryptor(key, iv)) + { + string result; + using (var msDecrypt = new MemoryStream(cipher)) + { + using (var csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) + { + using (var srDecrypt = new StreamReader(csDecrypt)) + { + result = srDecrypt.ReadToEnd(); + } + } + } + return result; + } + } + } + + private static char Cipher(char ch, int key) + { + if (!char.IsLetter(ch)) + return ch; + + char offset = char.IsUpper(ch) ? 'A' : 'a'; + return (char)((((ch + key) - offset) % 26) + offset); + } + + public static string Encipher(string input, int key) + { + string output = string.Empty; + + foreach (char ch in input) + output += Cipher(ch, key); + + return output; + } + + public static string Decipher(string input, int key) + { + return Encipher(input, 26 - key); + } + + + static public byte[] Encryption(byte[] Data, bool DoOAEPPadding) + { + try + { + byte[] encryptedData; + using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider()) + { + RSA.ImportParameters(RSA.ExportParameters(false)); + encryptedData = RSA.Encrypt(Data, DoOAEPPadding); + } + return encryptedData; + } + catch (CryptographicException e) + { + Console.WriteLine(e.Message); + return null; + } + } + + static public byte[] Decryption(byte[] Data, bool DoOAEPPadding) + { + try + { + byte[] decryptedData; + using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider()) + { + RSA.ImportParameters(RSA.ExportParameters(true)); + decryptedData = RSA.Decrypt(Data, DoOAEPPadding); + } + return decryptedData; + } + catch (CryptographicException e) + { + Console.WriteLine(e.ToString()); + return null; + } + } + */ + public static string Encryption(string strText) + { + var publicKey = "21wEnTU+mcD2w0Lfo1Gv4rtcSWsQJQTNa6gio05AOkV/Er9w3Y13Ddo5wGtjJ19402S71HUeN0vbKILLJdRSES5MHSdJPSVrOqdrll/vLXxDxWs/U0UT1c8u6k/Ogx9hTtZxYwoeYqdhDblof3E75d9n2F0Zvf6iTb4cI7j6fMs=AQAB"; + + var testData = Encoding.UTF8.GetBytes(strText); + + using (var rsa = new RSACryptoServiceProvider(1024)) + { + try + { + // client encrypting data with public key issued by server + rsa.FromXmlString(publicKey.ToString()); + + var encryptedData = rsa.Encrypt(testData, true); + + var base64Encrypted = Convert.ToBase64String(encryptedData); + + return base64Encrypted; + } + finally + { + rsa.PersistKeyInCsp = false; + } + } + } + + public static string Decryption(string strText) + { + var privateKey = "21wEnTU+mcD2w0Lfo1Gv4rtcSWsQJQTNa6gio05AOkV/Er9w3Y13Ddo5wGtjJ19402S71HUeN0vbKILLJdRSES5MHSdJPSVrOqdrll/vLXxDxWs/U0UT1c8u6k/Ogx9hTtZxYwoeYqdhDblof3E75d9n2F0Zvf6iTb4cI7j6fMs=AQAB

/aULPE6jd5IkwtWXmReyMUhmI/nfwfkQSyl7tsg2PKdpcxk4mpPZUdEQhHQLvE84w2DhTyYkPHCtq/mMKE3MHw==

3WV46X9Arg2l9cxb67KVlNVXyCqc/w+LWt/tbhLJvV2xCF/0rWKPsBJ9MC6cquaqNPxWWEav8RAVbmmGrJt51Q==8TuZFgBMpBoQcGUoS2goB4st6aVq1FcG0hVgHhUI0GMAfYFNPmbDV3cY2IBt8Oj/uYJYhyhlaj5YTqmGTYbATQ==FIoVbZQgrAUYIHWVEYi/187zFd7eMct/Yi7kGBImJStMATrluDAspGkStCWe4zwDDmdam1XzfKnBUzz3AYxrAQ==QPU3Tmt8nznSgYZ+5jUo9E0SfjiTu435ihANiHqqjasaUNvOHKumqzuBZ8NRtkUhS6dsOEb8A2ODvy7KswUxyA==cgoRoAUpSVfHMdYXW9nA3dfX75dIamZnwPtFHq80ttagbIe4ToYYCcyUz5NElhiNQSESgS5uCgNWqWXt5PnPu4XmCXx6utco1UVH8HGLahzbAnSy6Cj3iUIQ7Gj+9gQ7PkC434HTtHazmxVgIR5l56ZjoQ8yGNCPZnsdYEmhJWk=
"; + + var testData = Encoding.UTF8.GetBytes(strText); + + using (var rsa = new RSACryptoServiceProvider(1024)) + { + try + { + var base64Encrypted = strText; + + // server decrypting data with private key + rsa.FromXmlString(privateKey); + + var resultBytes = Convert.FromBase64String(base64Encrypted); + var decryptedBytes = rsa.Decrypt(resultBytes, true); + var decryptedData = Encoding.UTF8.GetString(decryptedBytes); + return decryptedData.ToString(); + } + finally + { + rsa.PersistKeyInCsp = false; + } + } + } + + } + } diff --git a/appsettings.json b/appsettings.json index 22a9fd1..546759a 100644 --- a/appsettings.json +++ b/appsettings.json @@ -20,9 +20,11 @@ "ExpirationHours": 4, "ExpirationMinutes": 1 }, - "EmailServer": "146.20.161.11", - "EmailPort": 587, - "Email": "noreply@alphaomega.com.mx", + "EmailServer": "alphaomega-com-mx.mail.protection.outlook.com", + "EmailPort": "25", + "EmailUser": "noreply", + "EmailDomian":"alphaomega.com.mx", + "EmailAccount":"noreply@alphaomega.com.mx", "EmailPassword": "Al%G22a3", "pathArchivoElectronico": "D:\\data\\ArchivoElectronicoSIR\\www.gemcousa.com\\SIR-GEMCO\\DOCS-SIR\\", "pathTemp": "D:\\data\\temp\\", diff --git a/bin/Debug/net6.0/AOLBackend.deps.json b/bin/Debug/net6.0/AOLBackend.deps.json index 90d370f..be5488c 100644 --- a/bin/Debug/net6.0/AOLBackend.deps.json +++ b/bin/Debug/net6.0/AOLBackend.deps.json @@ -10,6 +10,7 @@ "dependencies": { "Dapper": "2.0.123", "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.8", + "Microsoft.Exchange.WebServices": "2.2.0", "Microsoft.IdentityModel.JsonWebTokens": "6.22.0", "Microsoft.IdentityModel.Tokens": "6.22.0", "Swashbuckle.AspNetCore": "6.2.3", @@ -40,6 +41,18 @@ } }, "Microsoft.CSharp/4.5.0": {}, + "Microsoft.Exchange.WebServices/2.2.0": { + "runtime": { + "lib/40/Microsoft.Exchange.WebServices.Auth.dll": { + "assemblyVersion": "15.0.0.0", + "fileVersion": "15.0.913.0" + }, + "lib/40/Microsoft.Exchange.WebServices.dll": { + "assemblyVersion": "15.0.0.0", + "fileVersion": "15.0.913.15" + } + } + }, "Microsoft.Extensions.ApiDescription.Server/3.0.0": {}, "Microsoft.IdentityModel.Abstractions/6.22.0": { "runtime": { @@ -271,6 +284,13 @@ "path": "microsoft.csharp/4.5.0", "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" }, + "Microsoft.Exchange.WebServices/2.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NlkaTD0uWtg9VbiWq0VDWMBPzHFknH3tmstrxt0acrT09LBGqATTjRpsGOODz6tUdX7/dehBinxsf75U5Uw/+A==", + "path": "microsoft.exchange.webservices/2.2.0", + "hashPath": "microsoft.exchange.webservices.2.2.0.nupkg.sha512" + }, "Microsoft.Extensions.ApiDescription.Server/3.0.0": { "type": "package", "serviceable": true, diff --git a/bin/Debug/net6.0/AOLBackend.dll b/bin/Debug/net6.0/AOLBackend.dll index 19a5452..cf586e4 100644 Binary files a/bin/Debug/net6.0/AOLBackend.dll and b/bin/Debug/net6.0/AOLBackend.dll differ diff --git a/bin/Debug/net6.0/AOLBackend.pdb b/bin/Debug/net6.0/AOLBackend.pdb index 1d852bd..c465b0b 100644 Binary files a/bin/Debug/net6.0/AOLBackend.pdb and b/bin/Debug/net6.0/AOLBackend.pdb differ diff --git a/bin/Debug/net6.0/appsettings.json b/bin/Debug/net6.0/appsettings.json index 5072260..546759a 100644 --- a/bin/Debug/net6.0/appsettings.json +++ b/bin/Debug/net6.0/appsettings.json @@ -20,8 +20,12 @@ "ExpirationHours": 4, "ExpirationMinutes": 1 }, - "EmailServer": "146.20.161.11", - "EmailPort": 587, + "EmailServer": "alphaomega-com-mx.mail.protection.outlook.com", + "EmailPort": "25", + "EmailUser": "noreply", + "EmailDomian":"alphaomega.com.mx", + "EmailAccount":"noreply@alphaomega.com.mx", + "EmailPassword": "Al%G22a3", "pathArchivoElectronico": "D:\\data\\ArchivoElectronicoSIR\\www.gemcousa.com\\SIR-GEMCO\\DOCS-SIR\\", "pathTemp": "D:\\data\\temp\\", "pathFotosBodega": "D:\\data\\Bodega\\Fotos\\", diff --git a/obj/AOLBackend.csproj.nuget.dgspec.json b/obj/AOLBackend.csproj.nuget.dgspec.json index 41d8be2..f4e4de4 100644 --- a/obj/AOLBackend.csproj.nuget.dgspec.json +++ b/obj/AOLBackend.csproj.nuget.dgspec.json @@ -48,6 +48,10 @@ "target": "Package", "version": "[6.0.8, )" }, + "Microsoft.Exchange.WebServices": { + "target": "Package", + "version": "[2.2.0, )" + }, "Microsoft.IdentityModel.JsonWebTokens": { "target": "Package", "version": "[6.22.0, )" diff --git a/obj/Debug/net6.0/AOLBackend.MvcApplicationPartsAssemblyInfo.cs b/obj/Debug/net6.0/AOLBackend.MvcApplicationPartsAssemblyInfo.cs index 43d96a6..5c337f8 100644 --- a/obj/Debug/net6.0/AOLBackend.MvcApplicationPartsAssemblyInfo.cs +++ b/obj/Debug/net6.0/AOLBackend.MvcApplicationPartsAssemblyInfo.cs @@ -1,7 +1,6 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/obj/Debug/net6.0/AOLBackend.assets.cache b/obj/Debug/net6.0/AOLBackend.assets.cache index 1389778..09c611f 100644 Binary files a/obj/Debug/net6.0/AOLBackend.assets.cache and b/obj/Debug/net6.0/AOLBackend.assets.cache differ diff --git a/obj/Debug/net6.0/AOLBackend.csproj.AssemblyReference.cache b/obj/Debug/net6.0/AOLBackend.csproj.AssemblyReference.cache index 03bba73..d466249 100644 Binary files a/obj/Debug/net6.0/AOLBackend.csproj.AssemblyReference.cache and b/obj/Debug/net6.0/AOLBackend.csproj.AssemblyReference.cache differ diff --git a/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache b/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache index 809d404..2e77952 100644 --- a/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache +++ b/obj/Debug/net6.0/AOLBackend.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -543d6e2052e74dfe9cc3f60cc2cb0d6f72d7753c +5f1a72562e39ad6a97279c67e056dd811ddf7a4f diff --git a/obj/Debug/net6.0/AOLBackend.csproj.FileListAbsolute.txt b/obj/Debug/net6.0/AOLBackend.csproj.FileListAbsolute.txt index c302dfa..8706212 100644 --- a/obj/Debug/net6.0/AOLBackend.csproj.FileListAbsolute.txt +++ b/obj/Debug/net6.0/AOLBackend.csproj.FileListAbsolute.txt @@ -82,3 +82,5 @@ C:\projects\staging\AOLBackend\obj\Debug\net6.0\refint\AOLBackend.dll C:\projects\staging\AOLBackend\obj\Debug\net6.0\AOLBackend.pdb C:\projects\staging\AOLBackend\obj\Debug\net6.0\AOLBackend.genruntimeconfig.cache C:\projects\staging\AOLBackend\obj\Debug\net6.0\ref\AOLBackend.dll +C:\projects\staging\AOLBackend\bin\Debug\net6.0\Microsoft.Exchange.WebServices.Auth.dll +C:\projects\staging\AOLBackend\bin\Debug\net6.0\Microsoft.Exchange.WebServices.dll diff --git a/obj/Debug/net6.0/AOLBackend.dll b/obj/Debug/net6.0/AOLBackend.dll index 19a5452..cf586e4 100644 Binary files a/obj/Debug/net6.0/AOLBackend.dll and b/obj/Debug/net6.0/AOLBackend.dll differ diff --git a/obj/Debug/net6.0/AOLBackend.pdb b/obj/Debug/net6.0/AOLBackend.pdb index 1d852bd..c465b0b 100644 Binary files a/obj/Debug/net6.0/AOLBackend.pdb and b/obj/Debug/net6.0/AOLBackend.pdb differ diff --git a/obj/Debug/net6.0/ref/AOLBackend.dll b/obj/Debug/net6.0/ref/AOLBackend.dll index 12e88de..34e0240 100644 Binary files a/obj/Debug/net6.0/ref/AOLBackend.dll and b/obj/Debug/net6.0/ref/AOLBackend.dll differ diff --git a/obj/Debug/net6.0/refint/AOLBackend.dll b/obj/Debug/net6.0/refint/AOLBackend.dll index 12e88de..34e0240 100644 Binary files a/obj/Debug/net6.0/refint/AOLBackend.dll and b/obj/Debug/net6.0/refint/AOLBackend.dll differ diff --git a/obj/project.assets.json b/obj/project.assets.json index 5da92e6..6e57d8c 100644 --- a/obj/project.assets.json +++ b/obj/project.assets.json @@ -35,6 +35,17 @@ "lib/netcoreapp2.0/_._": {} } }, + "Microsoft.Exchange.WebServices/2.2.0": { + "type": "package", + "compile": { + "lib/40/Microsoft.Exchange.WebServices.Auth.dll": {}, + "lib/40/Microsoft.Exchange.WebServices.dll": {} + }, + "runtime": { + "lib/40/Microsoft.Exchange.WebServices.Auth.dll": {}, + "lib/40/Microsoft.Exchange.WebServices.dll": {} + } + }, "Microsoft.Extensions.ApiDescription.Server/3.0.0": { "type": "package", "build": { @@ -440,6 +451,26 @@ "version.txt" ] }, + "Microsoft.Exchange.WebServices/2.2.0": { + "sha512": "NlkaTD0uWtg9VbiWq0VDWMBPzHFknH3tmstrxt0acrT09LBGqATTjRpsGOODz6tUdX7/dehBinxsf75U5Uw/+A==", + "type": "package", + "path": "microsoft.exchange.webservices/2.2.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "doc/License Terms.rtf", + "doc/README.htm", + "doc/Redist.txt", + "lib/40/Microsoft.Exchange.WebServices.Auth.dll", + "lib/40/Microsoft.Exchange.WebServices.Auth.pdb", + "lib/40/Microsoft.Exchange.WebServices.Auth.xml", + "lib/40/Microsoft.Exchange.WebServices.dll", + "lib/40/Microsoft.Exchange.WebServices.pdb", + "lib/40/Microsoft.Exchange.WebServices.xml", + "microsoft.exchange.webservices.2.2.0.nupkg.sha512", + "microsoft.exchange.webservices.nuspec" + ] + }, "Microsoft.Extensions.ApiDescription.Server/3.0.0": { "sha512": "LH4OE/76F6sOCslif7+Xh3fS/wUUrE5ryeXAMcoCnuwOQGT5Smw0p57IgDh/pHgHaGz/e+AmEQb7pRgb++wt0w==", "type": "package", @@ -1089,6 +1120,7 @@ "net6.0": [ "Dapper >= 2.0.123", "Microsoft.AspNetCore.Authentication.JwtBearer >= 6.0.8", + "Microsoft.Exchange.WebServices >= 2.2.0", "Microsoft.IdentityModel.JsonWebTokens >= 6.22.0", "Microsoft.IdentityModel.Tokens >= 6.22.0", "Swashbuckle.AspNetCore >= 6.2.3", @@ -1143,6 +1175,10 @@ "target": "Package", "version": "[6.0.8, )" }, + "Microsoft.Exchange.WebServices": { + "target": "Package", + "version": "[2.2.0, )" + }, "Microsoft.IdentityModel.JsonWebTokens": { "target": "Package", "version": "[6.22.0, )" @@ -1185,5 +1221,17 @@ "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.300\\RuntimeIdentifierGraph.json" } } - } + }, + "logs": [ + { + "code": "NU1701", + "level": "Warning", + "warningLevel": 1, + "message": "Package 'Microsoft.Exchange.WebServices 2.2.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project.", + "libraryId": "Microsoft.Exchange.WebServices", + "targetGraphs": [ + "net6.0" + ] + } + ] } \ No newline at end of file diff --git a/obj/project.nuget.cache b/obj/project.nuget.cache index 772fc7d..0029208 100644 --- a/obj/project.nuget.cache +++ b/obj/project.nuget.cache @@ -1,12 +1,13 @@ { "version": 2, - "dgSpecHash": "h1u0HQs4mEbTV4WJsMrgE3Hunt3CLJp7/89fjgdV6zy7e/QRVuYOEoC0xk2j+AEakhvCr9H5jhqvtHtrM+sycw==", + "dgSpecHash": "vtGVP4zlfFh7svdNka07v8HE+UbShU24VyzMRrIOsfcHbJgxmkIUVuYTGIVIeBwbHwL1S8FAVOvE2Y5Jpbw8Lg==", "success": true, "projectFilePath": "C:\\projects\\staging\\AOLBackend\\AOLBackend.csproj", "expectedPackageFiles": [ "C:\\Users\\Alfonso Garcia\\.nuget\\packages\\dapper\\2.0.123\\dapper.2.0.123.nupkg.sha512", "C:\\Users\\Alfonso Garcia\\.nuget\\packages\\microsoft.aspnetcore.authentication.jwtbearer\\6.0.8\\microsoft.aspnetcore.authentication.jwtbearer.6.0.8.nupkg.sha512", "C:\\Users\\Alfonso Garcia\\.nuget\\packages\\microsoft.csharp\\4.5.0\\microsoft.csharp.4.5.0.nupkg.sha512", + "C:\\Users\\Alfonso Garcia\\.nuget\\packages\\microsoft.exchange.webservices\\2.2.0\\microsoft.exchange.webservices.2.2.0.nupkg.sha512", "C:\\Users\\Alfonso Garcia\\.nuget\\packages\\microsoft.extensions.apidescription.server\\3.0.0\\microsoft.extensions.apidescription.server.3.0.0.nupkg.sha512", "C:\\Users\\Alfonso Garcia\\.nuget\\packages\\microsoft.identitymodel.abstractions\\6.22.0\\microsoft.identitymodel.abstractions.6.22.0.nupkg.sha512", "C:\\Users\\Alfonso Garcia\\.nuget\\packages\\microsoft.identitymodel.jsonwebtokens\\6.22.0\\microsoft.identitymodel.jsonwebtokens.6.22.0.nupkg.sha512", @@ -31,5 +32,16 @@ "C:\\Users\\Alfonso Garcia\\.nuget\\packages\\system.security.cryptography.cng\\4.5.0\\system.security.cryptography.cng.4.5.0.nupkg.sha512", "C:\\Users\\Alfonso Garcia\\.nuget\\packages\\system.security.principal.windows\\4.7.0\\system.security.principal.windows.4.7.0.nupkg.sha512" ], - "logs": [] + "logs": [ + { + "code": "NU1701", + "level": "Warning", + "warningLevel": 1, + "message": "Package 'Microsoft.Exchange.WebServices 2.2.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project.", + "libraryId": "Microsoft.Exchange.WebServices", + "targetGraphs": [ + "net6.0" + ] + } + ] } \ No newline at end of file diff --git a/obj/staticwebassets.pack.sentinel b/obj/staticwebassets.pack.sentinel index a812a0f..f3b9bd9 100644 --- a/obj/staticwebassets.pack.sentinel +++ b/obj/staticwebassets.pack.sentinel @@ -303,3 +303,149 @@ 2.0 2.0 2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0