Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Access a Single Private Repo in Bitbucket for Composer (Like GitHub/GitLab Personal Access To

takielias
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 6, 2025

Hi everyone,

On GitHub/GitLab we can generate a personal access token and use it directly in Composer to give access to a single private repository.

In Bitbucket, I see that we can use OAuth consumer key/secret, but that seems to work at the workspace level — meaning it gives access to all private repos in the workspace.

What I actually need:

  • A way to give Composer access to only one private PHP library repo.

  • I don’t want to expose or allow access to all repos in my workspace.

  • Basically, I want something like GitHub/GitLab tokens that I can drop into Composer so that running composer install will pull from just that one repo.

Is there any way to do this in Bitbucket?

Thanks in advance for any suggestions.

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 8, 2025

Hi @takielias 

For your use case I'd suggest using a repository access token, they are scoped for a singular repository and you can configure the permissions granted to the access token for that repository:

Please let me know if you need further assistance.

Cheers!

- Ben (Bitbucket Cloud Support)

Taki Ahmad Elias
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 14, 2025

Hi @Ben ,

Thanks for the suggestion. But if I understand correctly, a repository access token can technically be used by anyone who obtains it, since it’s not tied to a specific user. That’s not exactly what I’m looking for.

What I need is a way to ensure that only users who already have access to the repository can use it, rather than having a standalone token that could be shared.

Is there a way to enforce this kind of user-based restriction?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events