bitbucket-rest-api / bitbucket

BitBucket API gem - bitbucket_rest_api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OAuth token/secret

replay111 opened this issue · comments

Hi, I'm trying to connect to my BitBucket repos:

bb = BitBucket.new do |config|
    config.oauth_token   = ''
    config.oauth_secret  = ''
    config.client_id     = '*********'
    config.client_secret = '**************************'
    config.adapter       = :net_http
end

I've generated consumer key:secret pair, but how I can get oauth token:secret pair?

Without them I am not able to connect to API :(

+1

Would be nice to have an example to follow to get started. The assumption I'm making is that you have to roll your own to by going through the process of OAuth get the token/secret first.

Ok, but how to do this? How to generate from web/script those pairs of keys?
On the bitbucket interface I was able to generate client id and secret... I didn't find any place to generate token/secret :(

I could figure it out either assumption didn't pan out the way I thought. Just as lost as you are at this point :)

Back when I first put this together, I used omniauth-bitbucket (via devise) to do an OAuth flow to get the tokens. When BitBucket redirects the request back to your endpoint during the OAuth flow, it will include the token for that user that you combine with the secret you already have.