bitbucket-rest-api / bitbucket

BitBucket API gem - bitbucket_rest_api
MIT License
144 stars 174 forks source link

OAuth token/secret #82

Open replay111 opened 7 years ago

replay111 commented 7 years ago

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 :(

zeroedin commented 7 years ago

+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.

replay111 commented 7 years ago

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 :(

zeroedin commented 7 years ago

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

vongrippen commented 7 years ago

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.