アプリ パスワードを使用する
App passwords are being removed
App passwords are undergoing a series of controlled brownouts starting on 2026年06月 9日 and will be permanently removed on 2026年07月28日. All integrations using app passwords should start using API tokens with scopes immediately. Learn more about API tokens or check out the brownout schedule.
アプリ パスワードは、ユーザー アクセスが制限された単一目的のアクセス トークンです (作成時に指定)。これらのパスワードは、スクリプト作成、CI/CD ツール、 Bitbucket に接続された開発中のアプリケーションのテストに役立ちます。
To authenticate with Bitbucket Cloud using an App password, you will need the App password and the user’s Bitbucket username (not the App password label or the email address used for logging into Bitbucket and other Atlassian apps). Your Bitbucket username can be found on your Bitbucket Account settings page within your Bitbucket Personal settings.
次の例は、Git コマンド ライン インターフェイス (Git CLI) と Bitbucket Cloud REST API で Bitbucket Cloud アプリのパスワードを使用する方法を示しています。
Git コマンド ライン インターフェイスでアプリ パスワードを使用する
We recommend connecting to Bitbucket Cloud using SSH keys when interacting with the Git command line interface. App passwords should be used with Git in programs and scripts that are non-interactive, such as build tools and CI/CD applications. For details on setting up SSH keys for Bitbucket, see: Set up SSH keys for Bitbucket Cloud.
Git CLI で Bitbucket Cloud アプリ パスワードを使用するには、次の権限を持つアプリ パスワードを作成します。
リポジトリ読み取り (
repository)リポジトリ書き込み (
repository:write)
Git CLI でアプリ パスワードを使用するには、インタラクティブ プロンプトからアプリ パスワードを提供するか、URL にアプリ パスワードを含めるかの 2 つのオプションがあります。
インタラクティブ パスワード プロンプトによるアプリ パスワード
This method avoids storing the App password insecurely in the URL and requires the App password to be entered every time Git interacts with Bitbucket Cloud (commands such as git pull, git push, and git fetch). You will also need your Bitbucket username. Your Bitbucket username can be found on your Bitbucket Account settings page within your Bitbucket Personal settings.
インタラクティブ プロンプトを介してアプリ パスワードを指定するには、次のコマンドでリポジトリを複製します。
git clone https://{bitbucket_username}@bitbucket.org/{workspace}/{repository}.gitローカルデバイスにすでに複製されているリポジトリの場合は、次のコマンドでリモート URL をアップデートします。
git remote set-url origin https://{bitbucket_username}@bitbucket.org/{workspace}/{repository}.gitURL にアプリ パスワードを含める
アプリ パスワードをプレーンテキストとして保護せずに保存したり、git リモート URL の一部として永続的に保存したりしないことをお勧めします。この方法は、アプリ パスワードがビルド ツールの「秘密」変数として安全に保存されている場合に役立ちます。
インタラクティブ パスワード プロンプトなしでアプリ パスワードを使用するために、URL にアプリ パスワードを含めることができます。例: リポジトリを複製する場合は、次のコマンドを実行します。
git clone https://{bitbucket_username}:{app_password}@bitbucket.org/{workspace}/{repository}.gitローカルデバイスにすでに複製されているリポジトリの場合は、次のコマンドでリモート URL をアップデートします。
git remote set-url origin https://{bitbucket_username}:{app_password}@bitbucket.org/{workspace}/{repository}.gitBitbucket Wiki でアプリ パスワードを使用する
We recommend connecting to Bitbucket Cloud using SSH keys when interacting with the Git command line interface. App passwords should be used with Git in programs and scripts that are non-interactive, such as build tools and CI/CD applications. For details on setting up SSH keys for Bitbucket, see: Set up SSH keys for Bitbucket Cloud.
Git CLI を使用して Bitbucket Wiki で Bitbucket Cloud アプリ パスワードを使用するには、次の権限を持つアプリ パスワードを作成します: Wiki — 読み取りと書き込み (wiki)。
Git CLI でアプリ パスワードを使用するには、インタラクティブ プロンプトからアプリ パスワードを提供するか、URL にアプリ パスワードを含めるかの 2 つのオプションがあります。
インタラクティブ パスワード プロンプトによるアプリ パスワード
This method avoids storing the App password insecurely in the URL and requires the App password to be entered every time Git interacts with Bitbucket Cloud (commands such as git pull, git push, and git fetch). You will also need your Bitbucket username. Your Bitbucket username can be found on your Bitbucket Account settings page within your Bitbucket Personal settings.
インタラクティブ プロンプトを介してアプリ パスワードを指定するには、次のコマンドでリポジトリを複製します。
git clone https://{bitbucket_username}@bitbucket.org/{workspace}/{repository}.git/wikiローカルデバイスにすでに複製されているリポジトリの場合は、次のコマンドでリモート URL をアップデートします。
git remote set-url origin https://{bitbucket_username}@bitbucket.org/{workspace}/{repository}.git/wikiURL にアプリ パスワードを含める
アプリ パスワードをプレーンテキストとして保護せずに保存したり、git リモート URL の一部として永続的に保存したりしないことをお勧めします。この方法は、アプリ パスワードがビルド ツールの「秘密」変数として安全に保存されている場合に役立ちます。
インタラクティブ パスワード プロンプトなしでアプリ パスワードを使用するために、URL にアプリ パスワードを含めることができます。例: リポジトリを複製する場合は、次のコマンドを実行します。
git clone https://{bitbucket_username}:{app_password}@bitbucket.org/{workspace}/{repository}.git/wikiローカルデバイスにすでに複製されているリポジトリの場合は、次のコマンドでリモート URL をアップデートします。
git remote set-url origin https://{bitbucket_username}:{app_password}@bitbucket.org/{workBitbucket API でアプリ パスワードを使用する
If you are building an integration or app for Bitbucket Cloud, we recommend using OAuth where possible. For information on building a Bitbucket Cloud integration or app, visit Atlassian Developer - Bitbucket Cloud.
The following examples show how to use a Bitbucket Cloud App password with the curl command as a guide for how to authenticate with Bitbucket Cloud APIs. Both examples are querying the commits on a Bitbucket repository using the List commits API. You will need both the Bitbucket username and an App password. Your Bitbucket username can be found on your Bitbucket Account settings page within your Bitbucket Personal settings.
アプリ パスワードは、ユーザーの Bitbucket ユーザー名とともに、ログイン資格情報として送信できます。次に例を示します。
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repository}/commits' \
--user '{bitbucket_username}:{app_password}' \
--header 'Accept: application/json'Alternatively, they can be sent in a HTTP Authorization header after the Bitbucket username and App password have been base64 encoded. For example:
my_credentials_after_base64_encoding=`echo -n '{bitbucket_username}:{app_password}' | base64`
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repository}/commits' \
--header "Authorization: Basic $my_credentials_after_base64_encoding" \
--header 'Accept: application/json'
この内容はお役に立ちましたか?