# Bitbucket project access tokens

**URL:** <https://community.jenkins.io/t/bitbucket-project-access-tokens/7204>\
**Category:** Using Jenkins\
**Tags:** question, pipeline\
**Created:** [May 5, 2023, 3:53pm UTC](https://community.jenkins.io/t/bitbucket-project-access-tokens/7204 "2023-05-05T15:53:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrancisS](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@FrancisS](https://community.jenkins.io/u/FrancisS)\
**Post date:** [May 5, 2023, 3:53pm UTC](https://community.jenkins.io/t/bitbucket-project-access-tokens/7204/1 "2023-05-05T15:53:33Z")

</div>

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.

> **[Using Project Access Tokens | Bitbucket Cloud | Atlassian Support](https://support.atlassian.com/bitbucket-cloud/docs/using-project-access-tokens/)**
>
> How to use Bitbucket Project Access Tokens with Bitbucket APIs and Git CLI

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](https://x-token-auth:%24bitbucket-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.

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [May 5, 2023, 4:49pm UTC](https://community.jenkins.io/t/bitbucket-project-access-tokens/7204/2 "2023-05-05T16:49:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![FrancisS](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@FrancisS](https://community.jenkins.io/u/FrancisS)\
**Post date:** [May 5, 2023, 6:14pm UTC](https://community.jenkins.io/t/bitbucket-project-access-tokens/7204/3 "2023-05-05T18:14:04Z")

</div>

🤦‍♂️ good idea that worked great.

---

<div class="post-metadata">

**Author:** ![sayandcode](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/sayandcode/32/5183_2.png) [@sayandcode](https://community.jenkins.io/u/sayandcode)\
**Post date:** [August 14, 2023, 6:45am UTC](https://community.jenkins.io/t/bitbucket-project-access-tokens/7204/4 "2023-08-14T06:45:53Z")

</div>

Worked great for me too! Thanks!

---

<div class="post-metadata">

**Author:** ![unruledboy](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/unruledboy/32/5781_2.png) [@unruledboy](https://community.jenkins.io/u/unruledboy)\
**Post date:** [October 11, 2023, 12:59am UTC](https://community.jenkins.io/t/bitbucket-project-access-tokens/7204/5 "2023-10-11T00:59:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![waqasahmed1236](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/waqasahmed1236/32/8666_2.png) [@waqasahmed1236](https://community.jenkins.io/u/waqasahmed1236)\
**Post date:** [June 17, 2024, 6:18am UTC](https://community.jenkins.io/t/bitbucket-project-access-tokens/7204/6 "2024-06-17T06:18:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Schack](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@Schack](https://community.jenkins.io/u/Schack)\
**Post date:** [August 1, 2025, 5:36pm UTC](https://community.jenkins.io/t/bitbucket-project-access-tokens/7204/7 "2025-08-01T17:36:12Z")

</div>

Just adding my two cents. Thanks [@MarkEWaite](https://community.jenkins.io/u/markewaite) this worked!
