how to use app passwords?
Asked by uwobaer:

Hello,

received emails about "Bitbucket Cloud is ending support for Atlassian account password usage for interacting with Bitbucket API and Git over HTTPS".

There is no further information, how to retrieve an app password and how to use that later on.

I managed to get an app password after some searching (thanks for that, some words would have been helpful).

But i am still failing to push to the remote repository (remote: invalid credentials). Google was helpful and i found a stackoverflow entry, which mentioned that url template:

    git remote set-url origin https://[app-label]:[app-password]@bitbucket.org/[your-repo].git

But that also did not work. What is wrong pls?

Finally found an support document here: [https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/?utm_source=alert-email\&utm_medium=email\&utm_campaign=bbc-login-deprecation_EML-12079\&jobid=105398046\&subid=1539803444](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/?utm_source=alert-email&utm_medium=email&utm_campaign=bbc-login-deprecation_EML-12079&jobid=105398046&subid=1539803444)

But that is not mentioning the correct url.

Greetings and thank you for any help

If that problem will not be solved, we have to leave bitbucket.


Answers:
author: uwobaer
body: Finally found an support document here: [https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/?utm_source=alert-email\&utm_medium=email\&utm_campaign=bbc-login-deprecation_EML-12079\&jobid=105398046\&subid=1539803444](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/?utm_source=alert-email&utm_medium=email&utm_campaign=bbc-login-deprecation_EML-12079&jobid=105398046&subid=1539803444)

But that is not mentioning the correct url.


author: Theodora Boudale
body: Hi [@uwobaer](/t5/user/viewprofilepage/user-id/4784859),

The app password should be used in combination with your Bitbucket username, and not with the app password label.

If you   
**1.** Open your repository on Bitbucket Cloud website  
**2.** Select the **Source** page from the left-hand menu  
**3.** On that page, select the **Clone** button from the top right corner   
**4.** In the new panel that shows up, select **HTTPS** from the top right corner. You will then see in that panel the git clone command with an HTTPS URL, including your Bitbucket username

If you want to change the remote url of your clone with the **git remote set-url** command, you can use either the URL

```
https://BitbucketUsername@bitbucket.org/workspace-id/repo.git
```

Or, if you want to include the app password in the URL

```
https://BitbucketUsername:app-password@bitbucket.org/workspace-id/repo.git
```

where

**BitbucketUsername** replace with the username of your Bitbucket account which can also be found here <https://bitbucket.org/account/settings/>   
**app-password** replace with the value of the app password you created  
**workspace-id** replace with the workspace ID of the workspace where this repo belongs to  
**repo** replace with the repo slug

The values for **BitbucketUsername** , **workspace-id,** and **repo** can also be seen in the URL in the Clone dialog if you follow the 4 steps I mentioned at the beginning of my reply.

++If you are using a credential manager:++

You can check if your machine is using a credential manager for Git with the following commands:

```
git config --system credential.helper
git config --global credential.helper
```

The first command will show if a credential helper for Git has been set for all users in the system, and the second command will show if a credential helper for Git has been set for your user.  
If a credential manager is used, make sure you remove from it any saved credentials for bitbucket.org

++If you use a Git GUI client++ for pulling/pushing instead of a terminal application, check if there are any saved credentials for bitbucket.org in that client and if your Bitbucket account has been added there with username+password.

If you are still facing issues, please let us know the following so we can better help you:

**1.** What is the URL format you are using now  
**2.** The full output of the git command that is failing (please mask in the output the actual username, workspace, and repo values)  
**3.** The output of the following commands on your machine

```
git config --system credential.helper
git config --global credential.helper
```

**4.** If you are using a Git GUI client, and if so which one

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora


author: uwobaer
body: Found an answer myself, the problem was in the permissions for the app password. Please you must give more info about that!

i had to create a new app password, that has read/write on projects and repositories. Not sure if that is really correct or is intended by bitbucket. no clue. there was absolutely no help info on that dialog and you also can not see later, which concrete permissions the app password actually has :(

so my problem is solved, but i am absolutely not sure if that really is the end of the story


author: uwobaer
body: when i instead use the url template

    https://[username]:[app-password]@bitbucket.org/[your-repo].git

i get the error: The requested URL returned error: 403


Tags: bitbucket-cloud

cloud

git

password