Skip to content
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

Bitbucket authorization #10

Open
manfe513 opened this issue Apr 18, 2023 · 5 comments
Open

Bitbucket authorization #10

manfe513 opened this issue Apr 18, 2023 · 5 comments

Comments

@manfe513
Copy link

Hi,
thank you for plugin!

I've tried to setup it with bitbucket webhooks, but encountered a situation:

  1. Bitbucket webhook sends a request with body signed by auth token via HMAC
    i.e. it doesn't add the Authorization header to request
    Can you somehow help me to solve this situation? I'm not familiar with plugin creating process

  2. You've mentioned this plugin uses personal token, can you somehow help me to make it use non-personal Teamcity token?

@netwolfuk
Copy link
Member

Hi @manfe513.

For TeamCity plugins the TeamCity server provides authentication before any of the plugin code is executed.

The easiest authentication method provided by TeamCity is to create a bearer token. TeamCity uses the name "personal token" because the token maps to a user's account in TeamCity.

I'm not sure what you mean by "non-personal token". After you referring to hmac as per your first question?

@netwolfuk
Copy link
Member

It looks like it is possible to use basic authentication instead of a bearer token to authenticate with teamcity.

There is a style of constructing a URL that includes the username and password. I have just tested it with curl, and it worked against my TeamCity dev server.

curl -X POST  \
http://username:[email protected]/app/rest/webhook-trigger/Utils_TcDummyDeb \
-d @trigger.json

You might be able to configure a similar URL in bitbucket that includes the username and password.
The username and password are the credentials of a teamcity user. You might choose to create a new user just for this, and provide as few permissions as possible for that user.

@manfe513
Copy link
Author

@netwolfuk
Thank you for your response!

Didn't know there's a possibility to provide credentials via URL that way - cool!
By saying non-personal - I mean,
may I use newly created personal access token (expiration in 5 years for example) in URL via username:access_token instead of password?

@netwolfuk
Copy link
Member

You could try using the token as the password, but I don't think it works.

@manfe513
Copy link
Author

Thanks for your response!
I'll try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants