1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SourceTreeでbitbucketのパスワード要求が頻発する

Last updated at Posted at 2019-01-05

目的

macでSourceTreeを導入してインストール時の要求に従ってbitbucketと連携した。
しかしclone/pull/pushのたびにパスワードを要求されて煩わしいので何とかしたい

原因

調べてみたところBasic認証を使っているのが原因のようだ。
68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3138313337352f66636338323662362d356631642d306566372d396439652d3064653365306562316636302e706e67.png

対策

sshの公開鍵をSourceTreeで生成してbitbucketに登録して、SourceTree上でアカウントをsshとして登録する。
まずSourceTree上でssh keyを生成する。
設定メニューのアカウントから認証方法をOAuthにしてプロトコルをsshにしてkeyを生成する
スクリーンショット 2019-01-04 10.45.11.jpg

生成したkeyをbitbucketのアカウント設定上のOAuth認証に登録する

ssh key登録

スクリーンショット 2019-01-04 11.01.14.png スクリーンショット 2019-01-04 11.01.07.png

OAuth 設定

特に必要なし。
SourceTreeでアカウント登録する際にbitbucketへ認証のためブラウザが立ち上がるので接続すればOK

参考サイト
https://www.granfairs.com/blog/cto/set-ssh-to-backlog
https://www.granfairs.com/blog/staff/sourcetree-ssh

結果

SourceTree上でリモートタブからリポジトリ一覧の取得が「Could not authorize request with the available token. Please re-authenticate.」
というメッセージが表示されてアクセスできない。
試しに、個別にリポジトリをURL指定「git@********.git」でcloneを試みたらできた。push/pullも問題なくできているのでSourceTreeのバグなのかも

今回のパスワード入力を毎回要求されることはこれでなくなったので一旦調査終了。

  • 追記
    OAuth認証ではなくBasic認証でもパスワード入力を要求されることはなかったのでBasic認証に変更
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?