Closed ciro-webcom closed 6 years ago
So, two things that may be wrong:
Most commands are asynchronous. Are you ensuring that you wait for each one to finish before proceeding with the next? Maybe your code example needs to look something like this:
// Async Promise
lpass.loadVault(USERNAME, PASSWORD).then(function () {
try {
// Sync
lpass.getVault();
} catch (error) {
console.error(error);
}
}).then(function () {
// Async Promise
lpass.getAccounts(USERNAME, PASSWORD).then(function (accounts) {
console.log(accounts);
}).catch(function (error) {
console.error(error);
});
}).catch(function (error) {
console.error(error);
});
This error you are receiving...
digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
...is usually indicative of either a bad USERNAME
or PASSWORD
. Can you please try to ensure that they are correct?
Hi, Thank you for your answer. My credentials are correct, the code was the same than the /example/index.js one. I replaced it with the code in your answer, I just added Lastpass initialization and imports:
import Lastpass from '../index';
import { USERNAME, PASSWORD, FILE, SEARCH } from './credentials';
const lpass = new Lastpass(USERNAME);
lpass.loadVault(USERNAME, PASSWORD).then(function () {
try {
// Sync
lpass.getVault();
} catch (error) {
console.error(error);
}
}).then(function () {
// Async Promise
lpass.getAccounts(USERNAME, PASSWORD).then(function (accounts) {
console.log(accounts);
}).catch(function (error) {
console.error(error);
});
}).catch(function (error) {
console.error(error);
});
Is this correct? Because I get the same error. Sorry but I don't know(for the moment) ES6 specifications, I'm reading that at the moment.
I am pretty sure that you are having issues because your USERNAME
or PASSWORD
is wrong, but just in case it's not, can you please try the following ES5 example?
This is fully compatible with node
itself, no need for babel
or the like.
lastpass-test.js
and package.json
YOUR USERNAME HERE
with your usernameYOUR PASSWORD HERE
with your passwordnpm install
, to install the dependencynode ./lastpass-test.js
to check if you get the same errorlastpass-test.js
var Lastpass = require('lastpass').default;
var USERNAME = 'YOUR USERNAME HERE';
var PASSWORD = 'YOUR PASSWORD HERE';
var lpass = new Lastpass(USERNAME);
// Async Promise
lpass.loadVault(USERNAME, PASSWORD).then(function () {
try {
// Sync
lpass.getVault();
} catch (error) {
console.error('Get vault error:', error);
}
}).then(function () {
// Async Promise
lpass.getAccounts(USERNAME, PASSWORD).then(function (accounts) {
console.log(accounts);
}).catch(function (error) {
console.error('Get accounts error:', error);
});
}).catch(function (error) {
console.error('Load vault error:', error);
});
package.json
{
"scripts": {
"start": "node ./lastpass-test.js"
},
"dependencies": {
"lastpass": "^1.0.2"
}
}
I tested this myself on node
version v6.3.1
without any issues. What version of node
are you using by the way? You can check by running node -v
.
Hi, Now I have a different error, but from lastpass which block my IP because I tried to connect from another country. I think I will send them an email, or maybe waiting to come back from holidays. Thank you for your time, I think the problem is resolved. I tried again the first script that you sent me and get the same error than with the last one, so I think that the problem was the big number of connection trials and now the different location. Thank you very much for your patience and time and I will inform you if I will have others problem. And obviously, great work!
Hi, I'm sorry to inform you that I still have problems while getting account : Get accounts error: Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt at Error (native) at Decipher.Cipher.final (crypto.js:150:26) at decrypt (/var/www/html/lastpassnobabel/node_modules/lastpass/dist/lib/decryptData.js:12:62)
Maybe it's not aes-256-cbc? I really don't understand, because it connect to lastpass but it can't get account
I tried with two differents accounts with the same result
Can you try to create a Lastpass account that I can help you with? I cannot reproduce this error.
Also, what version of node are you running?
Hi, this is an old issue but I was able to reproduce this. With my personal account I'm able to decrypt de blob file with me credentials for that account. With an enterprise account, none of the users (they have admin rights) can access the accounts associated with that enterprise account, they always get the error mentioned in this thread.
@JoelBMatias, hmmm. I don't have an enterprise account at all so I am not quite sure how to go about solving that...
Hello! I have got an enterprise account. And I can't connect to the LastPass. Maby I can help you?
Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
at Decipher.final (internal/crypto/cipher.js:104:26)
at decrypt (/Users/andreisoroka/git/data-integrator/node_modules/lastpass/dist/lib/decryptData.js:12:62)
at exports.default (/Users/andreisoroka/git/data-integrator/node_modules/lastpass/dist/lib/decryptData.js:25:17)
at exports.default (/Users/andreisoroka/git/data-integrator/node_modules/lastpass/dist/lib/openAccount.js:28:45)
at /Users/andreisoroka/git/data-integrator/node_modules/lastpass/dist/lib/openVault.js:32:60
at Generator.next (
I find and fixed. More information https://github.com/nodejs/node/issues/2794#issuecomment-139436581
Hi, I'm getting this error while using lpass.getAccounts. I'm not expert in node js but I don't understand why I get this error. The functions I used are :
With SEARCH = undefined; I take your index.js example and comment out functions I don't need. Can you tell me if I missed something? Thank you