Hello Atlassian team,
I am facing an issue with the credential when cloning a repository from the cloud server. I am able to login to the atlassian dashboard and home page but when I try to clone a repository from the project folder It ask me for a user credentials and when I provide the email address and the pwd it says incorrect/invalid credentials. Could you please help me in resolving this issue? Which credentials needs to be given while cloning the repository? Is the credential for login to cloud different from the credentials while cloning?
The credentials for Cloud are a bit different. Bitbucket Cloud wants your username and an API token created from your Atlassian account.
How do I create API token and pwd?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ram Kumar Shrestha, different credentials, yes. Bitbucket Cloud doesn't accept your Atlassian account password over HTTPS, which is why the clone prompt rejects it while the web login is fine.
Go to id.atlassian.com/manage-profile/security/api-tokens, choose Create API token with scopes, name it, set an expiry, pick Bitbucket as the app, then tick read:repository:bitbucket for cloning and write:repository:bitbucket as well if you'll push. Copy it there and then. It's shown once.
At the git prompt the username is the literal x-bitbucket-api-token-auth and the password is the token. Email plus token works for REST API calls, but git won't take that pairing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Gabriela for the information. I have created the token and saved it. Now when I try to clone the repository, I get a pop with asking user id and email. I gave user id as
user id: x-bitbucket-api-token-auth
Pwd: generated api token.
but it still says invalid credentials.
thanks and regards
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Am I doing something wrong here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ram Kumar Shrestha, that box in your screenshot isn't git asking you. It's Git Credential Manager's own Connect to Bitbucket dialog, and it's logging you in as an account, which is why it offers Can't log in and Sign up for an account underneath. x-bitbucket-api-token-auth isn't an account, it only means something to git itself, so that dialog turns it down.
Put your real Bitbucket username in there instead, the one on your bitbucket.org Personal settings page, with the same token as the password. Atlassian documents that flow as Bitbucket username and API token.
The static username does still work. Not in that dialog though. To prove the token itself is good, skip the helper for one command:
git -c credential.helper= clone https://bitbucket.org/WORKSPACE/REPO.git
An empty credential.helper resets the helper list, so git prompts you in the terminal and the static username goes through.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.