Open allaire opened 10 years ago
I'm not sure what's the API key you're using for password. My understanding is that if you use HTTP Basic authentication (as when you supply the LWRP with a user/pass combination) you're using an actual Bitbucket user and its password for credentials.
The token authentication scheme is for OAuth tokens.
You can use the Bitbucket API key for authentification (password).
The page oauth page you linked to creates two keys
Hey, sorry for not having looked into this for so long, but I was busy moving to another country. :)
I couldn't find any mention to an API key on the docs you linked. That's for a user's username and password as I mentioned before (or I might be drunk).
For the OAuth scheme, you have to create an Application Key first, then create an Access Token. The latter is the one you'll use to authenticate against the API.
Hi, I follow the guide provided here to create an Access Token.
https://confluence.atlassian.com/display/BITBUCKET/OAuth+on+Bitbucket
At the end of the guide (Step 4. Request an Access Token) the last request returns something like this :
oauth_token_secret=XXXX&oauth_token=YYYY
What do I have to use in the :token
parameter ? Is it XXXX
or YYYY
?
I tried both but I always get an HTTP 403 error (Access Forbidden).
deploy_key "bitbucket_key" do
provider Chef::Provider::DeployKeyBitbucket
path '/home/vagrant/.ssh'
credentials({
:token => 'XXXX'
})
repo 'my_company/my_project'
owner 'vagrant'
group 'vagrant'
mode 00640
action :add
end
Thanks,
Baptiste
I have to be honest with you and say that I haven't used this auth mechanism in BitBucket.
That said, have you tried sending the whole string, as in :token => 'oauth_token_secret=XXXX&oauth_token=YYYY'
? That seems to be what you need. Let me know if it works for you.
Hi @cassianoleal, thanks for you quick response.
I tried with :token => 'oauth_token_secret=XXXX&oauth_token=YYYY'
but encounter the same 403 error code.
@bgaillard Did you find a workaround?
Hi @mariomarin, sadly I did not found any solution for this, let me know if you find a workaround.
I've been doing some reading, and this should actually have been a full-blown OAuth implementation. I'll have to study it a bit further in order to get this to work, and I'm not sure I'll have the time any time soon.
If any of you want to take a stab at it, please do so. Pull requests are always welcome! :smile:
Wow, the last message on this is really recent.
I'd also like to set this up properly. It seems you have to get the token like
So we would need a full oauth implementation...
Why not just use https://github.com/vongrippen/bitbucket? Install the bitbucket gem and use the API to deploy.
+1
@kidovate I might have a look at that. It's worth noting, though that the maintainer has dropped support for that gem.
Which token are we supposed to use with Bitbucket? Currently I'm using username/password, and using the API key as the password.