robinhood-google-sheets icon indicating copy to clipboard operation
robinhood-google-sheets copied to clipboard

Incorrect Authentication credentials. Error while running script.

Open rs1990 opened this issue 5 years ago • 13 comments

HI

I followed the instructions and when i try to login , i get this error.

I have changed the username and password to the correct details. i confirmed using the same login credentials and they are correct.

Could you help please

Error Robinhood API request failed. 401: {"detail":"Incorrect authentication credentials."} (line 89).

rs1990 avatar Jan 09 '20 21:01 rs1990

Should be closed by https://github.com/rghuckins/robinhood-google-sheets/pull/10, pls try copy/pastaing latest robinhood.gs on that branch into your sheets [EDIT] and fill in the device_token

(you need a device_token for RH's new Oauth flow 😄 )

fkotsian avatar Mar 15 '20 17:03 fkotsian

I copied the latest robinhood.gs (the one w/ client_id in it) and I still get the same error as OP.

joecho27 avatar Mar 16 '20 22:03 joecho27

Same issue here as well.

ParitoshKelkar avatar Mar 24 '20 02:03 ParitoshKelkar

Hey guys, you need a device_token as well. Check out https://github.com/rghuckins/robinhood-google-sheets/pull/10/files

[EDIT: thanks @philgapp!]

fkotsian avatar Mar 26 '20 15:03 fkotsian

Still facing the same error ..

ParitoshKelkar avatar Apr 09 '20 17:04 ParitoshKelkar

I can confirm I am getting the identical error. I am building out a personal trade management tracker and planner in Sheets and Scripts. The client_id for my personal RH session in a browser matches what is in the latest version of this script: window.oauthClientId = "c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS"; (BROWSER) and 'client_id': "c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS", (SCRIPT) I did have MFA enabled but it is now disabled. I am going to attempt a logout in the browser, cache refresh and logging back in....

philgapp avatar Apr 20 '20 10:04 philgapp

I can confirm I am getting the identical error. I am building out a personal trade management tracker and planner in Sheets and Scripts. The client_id for my personal RH session in a browser matches what is in the latest version of this script: window.oauthClientId = "c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS"; (BROWSER) and 'client_id': "c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS", (SCRIPT) I did have MFA enabled but it is now disabled. I am going to attempt a logout in the browser, cache refresh and logging back in....

This is resolved for me by adding device_token to the function below: function getAccessToken_() { var url = robinhoodApiBaseUrl + '/oauth2/token/'; var payload = { 'grant_type': "password", 'scope': "internal", 'client_id': "c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS", 'device_token' : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", //'auth_token' : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 'username': robinhoodUsername, 'password': robinhoodPassword };

You can find this value by logging in with Chrome, Inspecting the page, go to Applications and expand the Cookies on the left, click the one for robinhood.com and then filter on the right for device_id. Copy that value and add it as device_token as above, and save and try again. Let me know, I want to actively use this in my project and share for help, as I'm not an expert developer by any means. I am however passionate about more intelligent trading software that helps educate and guide new investors.

philgapp avatar Apr 20 '20 11:04 philgapp

That worked for me too, thanks @philgapp

ParitoshKelkar avatar Apr 24 '20 16:04 ParitoshKelkar

I'm having this issue as well. I'm using the robinhood.gs script updated 10 days ago. I have a device token but I'm still getting an authentication credentials error.

KSanchez999 avatar Jul 09 '20 02:07 KSanchez999

@rghuckins I have all the correct info but I still receive this same error. Any help?

jomclky avatar Nov 17 '20 12:11 jomclky

Yep facing same issue as 2 commentors above me - I have the device_token (from the stackoverflow link) but still getting a 401 error code... (Invalid authentication credentials)

adeedchoudhury avatar Nov 24 '20 22:11 adeedchoudhury

Also got my device token and put in script editor, i get a text with a verification code and the same response as others in sheets cell: "incorrect authentication credentials"

cstampar avatar Jan 06 '21 23:01 cstampar

Thank you for this awesome code but I have the same issue. I took the device_id value from the website and pasted it in the code and saved but I still have issue. Can someone help me please? I have getting the following error

Robinhood API request failed. 401: {"detail":"Incorrect authentication credentials."} (line 84).

dheerajn avatar Jan 23 '21 01:01 dheerajn