Comments (13)
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.
from cookbook-deploy_key.
You can use the Bitbucket API key for authentification (password).
The page oauth page you linked to creates two keys
from cookbook-deploy_key.
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.
from cookbook-deploy_key.
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
from cookbook-deploy_key.
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.
from cookbook-deploy_key.
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.
from cookbook-deploy_key.
@bgaillard Did you find a workaround?
from cookbook-deploy_key.
Hi @mariomarin, sadly I did not found any solution for this, let me know if you find a workaround.
from cookbook-deploy_key.
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! 😄
from cookbook-deploy_key.
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.
from cookbook-deploy_key.
+1
from cookbook-deploy_key.
@kidovate I might have a look at that. It's worth noting, though that the maintainer has dropped support for that gem.
from cookbook-deploy_key.
https://bitbucket.org/site/master/issue/10182/access-tokens-for-command-line-use
from cookbook-deploy_key.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cookbook-deploy_key.