I’m trying to subscribe to certain channels using Coinbase’s Websocket API, but I’m having some authentication issues. I’ve generated signatures according to Coinbase’s requirements, but there still seems to be some issues.
When I try to authenticate using the above code, I get an authentication failure error.
Am I implementing the signature process correctly?
Are there any other authentication steps I may have missed?
Any suggestions and solutions would be greatly appreciated! Thanks!
Hi @sosponge
We are not sure about how this code is running and don’t know what errors they’re getting, but we would advise you to look at the documentation for Advanced Trading Authentication:
If you still have an issue, you can send us the error message you are receiving.
I was following this document, I made sure my apikey and key were fine, both were in enable state, but the final return still kept coming back as
{“type”: “error”, “message”: “authentication failure”}
In other topic you initially tried to encode signature in base64… In case you are decoding secret, you should not do that either. In Advanced Trade secret is not base64 encoded! Maybe that is your problem?
Thank you for the test data you provided. I have verified it using the data you provided and my code logic and the resulting signature does match exactly the one you provided:
966638555c9a658df42a6931d96260de6d78d50e9fe6c672a8cc6e1937068348
I have ensured that my apikey is enabled and all relevant permissions are turned on. However, I’m still experiencing problems with authentication not passing and I’m getting an “Authentication Failed” error message.
Can you provide some advice or guidance to help me resolve this issue?
Did you see extra comment about secret? You are NOT base64 decoding it, right?
I don’t use Java, does System.currentTimeMillis() returns time as unix timestamp? Looking at other posts I see that other people has used Instant.now().getEpochSecond() to get timestamp.
Hey sosponge - did you manage to solve this issue? I’m having exactly the same issue coding this up in Java. The api key and secret are working fine when signing via the REST api