A basic example of using Coinbase OAuth as well as the returned tokens. Created in response to:
- A tweet
- A StackOverflow question
- Another relevant SO question
- Create a new Coinbase application here
- Create a
.env
file in your project root using the keys from your newly registered application
COINBASE_API_KEY="your api key goes here"
COINBASE_API_SECRET="your api secret goes here"
- Run
bin/rake db:setup
to initialize the database - Run
bin/rails s
for the server - Visit the root '/' route
- Click the link to authenticate via OAuth for Coinbase
- You should be redirected to a 'test_refresh' page showing newly created tokens on each page load using the
Coinbase::OAuthClient#refresh!
method
- A very similar, official repo
Please email me with any questions.