aurbano / robinhood-node

:chart_with_upwards_trend: NodeJS client for Robinhood Trading :fire:
https://aurbano.github.io/robinhood-node
MIT License
694 stars 184 forks source link

Authentication failure (call to /api-token-auth/) #90

Closed patrocinio closed 4 years ago

patrocinio commented 6 years ago

It seems the old authentication API (/api-token-auth) has been removed. See discussion at https://www.reddit.com/r/algotrading/comments/9fatem/robinhood_api_login_issues/

Therefore the call to

var r = require ('robinhood')(credentials);
``

is failing with the following erorr:

portfolio-portfolio-85b7d56c6b-7xv6w portfolio Magic happens on port 80 portfolio-portfolio-85b7d56c6b-7xv6w portfolio /usr/src/app/node_modules/robinhood/src/robinhood.js:145 portfolio-portfolio-85b7d56c6b-7xv6w portfolio throw new Error( portfolio-portfolio-85b7d56c6b-7xv6w portfolio ^ portfolio-portfolio-85b7d56c6b-7xv6w portfolio portfolio-portfolio-85b7d56c6b-7xv6w portfolio Error: token not found {"statusCode":404,"body":"

Not Found

The requested URL /api-token-auth/ was not found on this server.

","headers":{"date":"Sun, 28 Oct 2018 15:58:52 GMT","content-type":"text/html; charset=utf-8","content-length":"89","connection":"keep-alive","server":"nginx","vary":"Accept-Language, Cookie","x-robinhood-api-version":"1.249.10","content-language":"en-us"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"api.robinhood.com","port":443,"hostname":"api.robinhood.com","hash":null,"search":null,"query":null,"pathname":"/api-token-auth/","path":"/api-token-auth/","href":"https://api.robinhood.com/api-token-auth/"},"method":"POST","headers":{"Accept":"*/*","Accept-Encoding":"gzip, deflate","Accept-Language":"en;q=1, fr;q=0.9, de;q=0.8, ja;q=0.7, nl;q=0.6, it;q=0.5","Content-Type":"application/x-www-form-urlencoded; charset=utf-8","Connection":"keep-alive","X-Robinhood-API-Version":"1.152.0","User-Agent":"Robinhood/5.32.0 (com.robinhood.release.Robinhood; build:3814; iOS 10.3.3)","content-length":50}}} portfolio-portfolio-85b7d56c6b-7xv6w portfolio at Request._callback (/usr/src/app/node_modules/robinhood/src/robinhood.js:145:21) portfolio-portfolio-85b7d56c6b-7xv6w portfolio at Request.self.callback (/usr/src/app/node_modules/request/request.js:185:22) portfolio-portfolio-85b7d56c6b-7xv6w portfolio at Request.emit (events.js:182:13) portfolio-portfolio-85b7d56c6b-7xv6w portfolio at Request. (/usr/src/app/node_modules/request/request.js:1161:10) portfolio-portfolio-85b7d56c6b-7xv6w portfolio at Request.emit (events.js:182:13) portfolio-portfolio-85b7d56c6b-7xv6w portfolio at IncomingMessage. (/usr/src/app/node_modules/request/request.js:1083:12) portfolio-portfolio-85b7d56c6b-7xv6w portfolio at Object.onceWrapper (events.js:273:13) portfolio-portfolio-85b7d56c6b-7xv6w portfolio at IncomingMessage.emit (events.js:187:15) portfolio-portfolio-85b7d56c6b-7xv6w portfolio at endReadableNT (_stream_readable.js:1081:12) portfolio-portfolio-85b7d56c6b-7xv6w portfolio at process._tickCallback (internal/process/next_tick.js:63:19)

aurbano commented 5 years ago

Have you tried with the latest version of robinhood node? We've changed the authentication to match the API changes