torreyleonard / algotrader

Simple algorithmic stock and option trading for Node.js.
https://www.npmjs.com/package/algotrader
Apache License 2.0
635 stars 119 forks source link

Robinhood responded with code 401: unauthorized. { "detail": "Incorrect authentication credentials." } #66

Open alexjavad opened 2 years ago

alexjavad commented 2 years ago

I'm trying to authenticate my Robinhood user programmatically, so I can issue trades programmatically, using the following recommended code:

const myUser = new User(credentials.username, credentials.password, options);

myUser.authenticate()
    .then(() => {
        // User was authenticated
        console.log("Algotrader User Authenticated...");
    })
    .catch(error => {
        console.log("Authentication Error: " + error);
    });

But I'm getting the following error printed to the console when I run the app.js file:

image

Can anyone shed some light on this issue please? Thanks in advance!