Coinbase v2 - help with authentication
See original GitHub issueHi, I have finally got some time to implement new v2 api but I have stucked right on the begining.
I would appreciate any help. I am overriding digestParams method in CoinbaseDigest.java and using API documentation from here https://developers.coinbase.com/api/v2?shell#authentication
I have chosen the users method to test it. I am still getting 401 error. I think, my generated hash is wrong.
CoinbaseAuthenticated.java
@GET
@Path("users/{id}")
CoinbaseUser getUser(@HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") ParamsDigest signer,
@HeaderParam("CB-ACCESS-TIMESTAMP") SynchronizedValueFactory<Long> nonce, @HeaderParam("id") String id) throws IOException, CoinbaseException;
CoinbaseDigest.java
@Override
public String digestParams(RestInvocation restInvocation) {
String message = restInvocation.getParamValue(HeaderParam.class, "CB-ACCESS-TIMESTAMP").toString() + restInvocation.getHttpMethod() + "/"
+ restInvocation.getPath() + (restInvocation.getRequestBody() != null ? restInvocation.getRequestBody() : "");
Mac mac256 = getMac();
mac256.update(message.getBytes());
String signature = Arrays.toString(mac256.doFinal());
return signature ;
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
How do I set up 2-step verification? - Coinbase Help
Coinbase provides several options for generating 2-step verification codes (AKA 2-factor or multi-factor authentication) with various levels of setup. What is 2 ......
Read more >What is 2-step verification? - Coinbase Help
Coinbase offers 2-step verification, known also as 2-factor (2FA) or multifactor authentication, as an added security layer in addition to your username and ......
Read more >2-step verification FAQ - Coinbase Help
Two-factor authentication (2FA), also known as 2-step verification, is a security layer in addition to your username and password. With 2FA enabled on...
Read more >How do I set up 2-factor authentication? - Coinbase Help
Coinbase provides several options for generating 2-step verification codes (AKA 2-factor or multi-factor authentication) with various levels of setup. What is 2 ......
Read more >2-step verification troubleshooting | Coinbase Help
1. Sign in to your Coinbase account using your email address and password. 2. When prompted for your 2-step verification code, select I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, I have solved it.
Thanks!
Goodmorning everyone, I have an authentication problem with my account, through the Coinbase.com API.
I tell you what’s happening to me:
{"errors":[{"id":"authentication_error","message":"invalid signature"}],"warnings":[{"id":"missing_version","message":"Please supply API version (YYYY-MM-DD) as CB-VERSION header","url":"https://developers.coinbase.com/api#versioning"}]}bool(true)
Since the examples are in other languages but I use PHP, I think I have made a mistake during the conversion of the script.
This is the link of the official guide:
https://developers.coinbase.com/docs/wallet/api-key-authentication
This is my script:
Do you give me your opinion? I’ve been stuck here for 5 days and I can not understand what I’m missing. The assistance of Coinbase does not answer me and I have a project to deliver blocked.
Thank you very much for any useful advice.