Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Authentication credentials. Error while running script. #9

Open
rs1990 opened this issue Jan 9, 2020 · 13 comments
Open

Incorrect Authentication credentials. Error while running script. #9

rs1990 opened this issue Jan 9, 2020 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@rs1990
Copy link

rs1990 commented Jan 9, 2020

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).
@rghuckins rghuckins added the help wanted Extra attention is needed label Feb 6, 2020
@fkotsian
Copy link
Contributor

fkotsian commented Mar 15, 2020

Should be closed by #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 😄 )

@joecho27
Copy link

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

@ParitoshKelkar
Copy link

Same issue here as well.

@fkotsian
Copy link
Contributor

fkotsian commented Mar 26, 2020

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

[EDIT: thanks @philgapp!]

@ParitoshKelkar
Copy link

Still facing the same error ..

@philgapp
Copy link

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
Copy link

philgapp commented Apr 20, 2020

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.

@ParitoshKelkar
Copy link

That worked for me too, thanks @philgapp

@KSanchez999
Copy link

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.

@jomclky
Copy link

jomclky commented Nov 17, 2020

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

@adeedchoudhury
Copy link

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)

@cstampar
Copy link

cstampar commented Jan 6, 2021

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"

@dheerajn
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests