-
Notifications
You must be signed in to change notification settings - Fork 129
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
Websocket: cannot subscribe with authentication #27
Comments
This is a user error. For a live version that works you can checkout what I've been implementing over here (which works daily for me) with the current code base. https://github.com/robevansuk/gdax-java/blob/master/src/main/java/com/coinbase/exchange/api/gui/orderbook/OrderBookView.java#L140 |
Also I have a bunch of commits on my machine that I intend to push in the not too distant future (weeks/month (or two)) which will provide an implementation of the orderbook. It's not quite ready yet as I need to build more tests and more logic around handling the live orders from the websocketfeed, but its coming along nicely now. |
@robevansuk I've had the same issue as @petnnw. Any guidance on what the user error is, or how to fix it? |
Hi, have you checked responses on StackOverflow? Some are from me as I try to follow along. Saying that I haven't looked too much at this in the last 6 months since the rebranding effort from GDAX -> Coinbase Pro |
Turns out the problem for me was that I was including my subscription body in my signature. For whatever reason, coinbase does not expect a body in the signature for the websocket feed. Was there something about the rebranding that caused you to lose interest? It's been about a year since I've been in the loop on this. |
I managed to solve this issue with the following changes:
Make these changes, then subscribe to |
@robevansuk Your code works well for the market data, because it does not need authentication. {"type":"subscribe", "channels":[{"name":"user","product_ids":["ETH-DAI","ETH-USDC","BAT-ETH"]}], you can quickly realize (even after inserting your valid credentials in the above JSON), that upon subscription you will receive: {"type":"error","message":"Authentication Failed","reason":"{"message":"invalid signature"}"} I also had the problems when I started to build an automated java trader, I have checked the code in node.js/javascript-api client to solve this issue and came to the same solution as @zoltanmajzik |
Hi!
Without authentication, I can subscribe to GDAX Websocket feed (any channel combination).
Instead, if I set my key, passphrase and secret code, then I get the answer:
{"type":"error","message":"Sorry, you could not be authenticated: Bad Request","reason":"invalid signature"}
According to the GDAX api, when specifying channels you must authenticate using the path:
"/users/self/verify"
(just"/users/self"
if you don't specify channels).However in
signObject()
onWebsocketFeed.java
, the path is "" as you might find on line 198:jsonObj.setSignature(signature.generate("", "GET", jsonString, timestamp));
I tried to correct the issue (i.e. setting the correct path), with no success.
The text was updated successfully, but these errors were encountered: