pipelines-as-code icon indicating copy to clipboard operation
pipelines-as-code copied to clipboard

Bitbucket server with bearer tokens

Open MAHDTech opened this issue 2 years ago • 4 comments

Hi, 👋🏻

I'm testing PAC with Bitbucket Server.

With a personal access token (username/token) I can get it to work fine.

I'm trying to test with a project bearer token, which doesn't require a username.

I know the bearer token works with curl

BEARER='bear_token_here'
PROJECT="project_name"
REPO="repo_name"

curl  \
  --insecure \
    --header "Authorization: Bearer ${BEARER}" \
    https://bitbucket.mycorp/bitbucket/rest/api/latest/projects/${PROJECT}/repos/${REPO}/commits

But when I define the Repository resource, I receive an error if I leave the username out, as shown here

I thought I might get away with a placeholder username, but looks like basicAuth is the only option at present when I look here

Have I missed an option somewhere to setup Bitbucket server with a Bearer token?

Thanks.

MAHDTech avatar Jun 28 '23 10:06 MAHDTech

I think it's something we will have to fix...

chmouel avatar Jun 29 '23 13:06 chmouel

@chmouel Is there any plans to look into this? Would be great to use Pipelines as code with Bitbucket without depending on a personal user token.

safeaim avatar Feb 28 '24 13:02 safeaim