Bitbucket project access tokens

I am trying to create a pipeline job with the pipeline script from SCM option. I am using a bitbucket cloud repo I would like to configure it with Bitbucket project access tokens.

There doesn’t seem to be a plugin that directly supports this type of authentication. It works if I include the token directly in the URL but then its visible all over the place including build logs. It would be nice if it could be stored as a secret somewhere and injected in the URL as needed, for example:
https://x-token-auth:$bitbucket-token@testorg/test.git
I know this is possible directly in build scripts with credential binding but I cant find a way to do it for the SMC url configured directly in the jenkins UI.

Have you tried creating a Jenkins username / password credential with the username x-token-auth and the password the value of the bitbucket token? The syntax of that URL looks very similar to a username / password URL.

4 Likes

:man_facepalming: good idea that worked great.

1 Like

Worked great for me too! Thanks!

1 Like

I looked all over the internet, @MarkEWaite provides the only answer that really works for me, genius!

1 Like

@MarkEWaite Thank you. I have created my account here just to thank you,