-1

I am having account in sandbox.coinbase and I have used oauth2 where I have add new app.

It'll provide me :

 clientid         = 'xxxxxxxx'
 clientsecreateid = 'xxxxxxxxxxxxxxxx'
 authredirecturl  = 'xxxxxxx'

But when I am configure it using below code

$configuration = Configuration::oauth($accessToken);
$client = Client::create($configuration);

I need $accessToken, I go through the document file but I can't find anywhere so any one have idea where to find or how to get accessToken..?

Codebrekers
  • 754
  • 1
  • 11
  • 29

1 Answers1

0

As the documentation states:

This library does not handle the handshake process, and assumes you have an access token when it's initialized. You can handle the handshake process using an OAuth2 client such as league/oauth2-client.

So you have to use the oauth2 client first, configure it with the coinbase server (using clientId, clientSecret and redirectUrl that you have) and pass the authorization process (much like "Login with facebook"). At the end of the oauth2 authorization coinbase will send you both access token and refresh token. They are generated on-the-fly.

Alternatively as I can see you can use the apiKey/apiSecret mode. This is essentially like having login/password.

Ruslan Bes
  • 2,715
  • 2
  • 25
  • 32