-
-
Notifications
You must be signed in to change notification settings - Fork 28
Issue with Client Credentials authentication #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sorry for the confusion. I tried to add support for This is the main file where it was added: /src/plugins/authentication/before-request.js
|
I was not able to use oauth either but I was able to work with
App password need to be generated in Bitbucket, you should get it from a config out of the source file and protect it but it's a password that you can use in a script / tool without exposing your main password. You can set access/ permission too wich is really preferable considering that you can do quite a lot of things with the api! Off-topic: Thanks for the lib. I have started to learn/use Pipelines but I had a major block as our dev server is behind a firewall and there would be quite a few hoops to jump to implement something like a callback url or a api. I thought about it and I'm currently working on a small proof of concept using slack api so that Bitbucket Cloud would send a message like "at-bot Deploy version x,y.z to dev" on slack app channel, my bot-server (connected to slack using RTM api) would receive and parse the message, use Bibucket NPM to resolve the url and download the file to complete the deploy and report back the results to the channel. It could also help me implement some kind of user friendly self-service with our QA server... ex. at-bot list-latest releases, at-bot deploy x.y.z to QA. It looks promising so far except, most of the work will be to parse the messages and recognize a basic list of patterns / commands. I have tried to get a test file using bitbucket.downloads.get (as the file is also in private repo) but I get a 500 error from Bitbucket Cloud... going to sleep, I'll check that again tomorrow. |
@MunifTanjim @eric-gagnon Another noticeable thing is that According to what I've written above, I think we need to implement to new methods — @MunifTanjim waiting for your approval about my statements, also thanks for lib, really cool 😃 If you don't mind, I'd like to implement them! |
Hey, guys, I have done a draft for what @MunifTanjim started with auth strategies. It's a draft, that's why structure is not justified yet. But the main functionality is implemented. Would be happy if someone would help me to finish it. Related PR #78 |
Any updates on the authentication PR? thanks! Also, Bitubkcet is deprecating basic auth for API requests. App password won't work because scopes are required for API requests. I think we can only use OAuth(access token), and the access token would be expired which we need a way to refresh it as well.
|
Hello @weilinzung ! So if you are using an app password with a Basic Authentication you should not be worried :) |
I'm using an app password generated on my account. I'm passing
I get a 401 error response
Should I be worried now? |
I am currently using this configuration, and no problems at the moment, with an app password.
|
I have discovered the issue. While I have a nearly identical code setup I was still getting the 401 error while using the generated app password. I was using the account email as username as that's what I login with through the web. However, after switching the username value to the actual username of the account everything works. |
Having the same problem. I can't authenticate using an app password or API token. const bitbucketClient = new bitbucket.Bitbucket({
auth: {
type: "apppassword",
username: "my name",
password: "my app password"
},
});
const pullRequests = await bitbucketClient.pullrequests.list({
repo_slug: "repo-slug",
workspace: "workspace",
}); I also tried my email and the app passwords label as username, but no success. I always get an Unauthorized error with message I also tried to use token authentication using a token generated here: https://id.atlassian.com/manage-profile/security/api-tokens. edit: sorry, my mistake. I tried to enter my Full name as username. The username that works can be found under 'Account Settings'. |
Is the authentication method Client Authentication Grant supported?
I found several references to it in the code, but I did not figure out how to use it successfully.
I tried using:
But this sets
key
andsecret
as query param, which is not correct (I don't see it mentioned anywhere in on the Authentication page):https://api.bitbucket.org/2.0/repositories/my-user/my-repo/commit/c0f212a586f0cf6be721f39acd334e9f4cdc9c48/statuses/build?client_id=****&client_secret=****
I also found the
clientCredentialsGrant
mentioned insrc/plugins/oauth/routes.js
, but this plugin is not hooked up insrc/index.js
and I'm not sure if / how it is supposed to be used.The text was updated successfully, but these errors were encountered: