diff --git a/src/app/services/aesencrypt.service.ts b/src/app/services/aesencrypt.service.ts index 551281a03..2a9f33289 100644 --- a/src/app/services/aesencrypt.service.ts +++ b/src/app/services/aesencrypt.service.ts @@ -23,6 +23,8 @@ export class AESEncrypt { //Decrypting the string contained in cipherParams using the PBKDF2 key var decrypted = CryptoJS.AES.encrypt(encryptData, key128Bits1000Iterations, { mode: CryptoJS.mode.CBC, iv: iv, padding: CryptoJS.pad.Pkcs7 }); console.log('AES encrypt',decrypted.toString()); + + return decrypted.toString(); } decrypt(deceyptData,pass) { @@ -43,6 +45,8 @@ export class AESEncrypt { //Decrypting the string contained in cipherParams using the PBKDF2 key var decrypted = CryptoJS.AES.decrypt(cipherParams, key128Bits1000Iterations, { mode: CryptoJS.mode.CBC, iv: iv, padding: CryptoJS.pad.Pkcs7 }); console.log('AES decrypt',decrypted.toString(CryptoJS.enc.Utf8)); + + return decrypted.toString(CryptoJS.enc.Utf8); } toHexString(byteArray) { diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index c2689d9e5..ca8a8c86e 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -52,8 +52,10 @@ export class AuthService { async login(user: UserForm): Promise { // user.BasicAuthKey = 'Basic ' + btoa(user.username + '@' + user.domainName + ':' + user.password); - user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + user.password); //conversão em base64 das credenciais inseridas + user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username )); + //conversão em base64 das credenciais inseridas console.log('Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username ))); //conversão em base64 das credenciais inseridas + console.log("Encript ",this.aesencrypt.encrypt(user.password,user.username )) this.headers = this.headers.set('Authorization',user.BasicAuthKey);