coinbase-java icon indicating copy to clipboard operation
coinbase-java copied to clipboard

Oauth Token CoinbaseBuilder Error

Open zrabatah opened this issue 9 years ago • 0 comments

I have a question about the CoinbaseBuilder.

I have followed the authentication example in the coinbase android sdk example (https://github.com/coinbase/coinbase-android-sdk), and I have successfully returned my email. In the onSuccess method in the CompleteAuthorizationTask class I am able to store the AccessToken into a String.

When I try to use this String to build a new CoinbaseBuilder I am able to create the Coinbase object (example below) (token is the AccessToken stored in a String from CompleteAuthorizationTask).

In onSuccess I use: token = tokens.getAccessToken();

In a button onClickListener I use the following code to create the Coinbase Object.

Coinbase cb = new CoinbaseBuilder() .withAccessToken(token) .build();

Whenever I try to call methods from my new cb object in the onClickListener after initializing the Coinbase object my app crashes (actually is caught in the try catch(Exception e) block.

Any ideas as to why I am not able to use the Coinbase object with the token that I am using? Is this the wrong token to initialize the Coinbase object?

I have attached the image of a typical access token that I receive and the cb object associated with the accesstoken. I also am curious as to why all the other values are null when I initialize the object (attached as a png). Based on the documentation on (https://github.com/coinbase/coinbase-java/blob/master/README.md), the required values in order to create the Coinbase object is only the OAuth token.

image

image

zrabatah avatar Nov 11 '17 03:11 zrabatah