【问题标题】:Mercurial bitbucket authorization failedMercurial bitbucket 授权失败
【发布时间】:2014-05-04 04:13:30
【问题描述】:

我根据 1Pass 的瞭望塔建议更改了我的 Bitbucket 密码。从那以后,尽管我可以通过浏览器登录,但我无法拉/推我的任何存储库。 HTTP 和 SSH 都试过了,都不管用。

这是一个示例输出。

hg pull --debug https://caliChander@bitbucket.org/caliChander/cs1
using https://bitbucket.org/caliChander/cs1
http auth: user caliChander, password not set
sending capabilities command
using auth.bitbucket.* for authentication
bitbucket.org certificate successfully verified
using auth.bitbucket.* for authentication
http auth: user caliChander, password *******************************
using auth.bitbucket.* for authentication
bitbucket.org certificate successfully verified
http auth: user caliChander, password *******************************
using auth.bitbucket.* for authentication
bitbucket.org certificate successfully verified
http auth: user caliChander, password *******************************
using auth.bitbucket.* for authentication
bitbucket.org certificate successfully verified
http auth: user caliChander, password *******************************
using auth.bitbucket.* for authentication
bitbucket.org certificate successfully verified
http auth: user caliChander, password *******************************
using auth.bitbucket.* for authentication
bitbucket.org certificate successfully verified
http auth: user caliChander, password *******************************
using auth.bitbucket.* for authentication
bitbucket.org certificate successfully verified
abort: authorization failed

我很好奇为什么当我的~/.hgrc 看起来像这样时它会显示“密码未设置”:

[ui]
username = First Last <some.email@random.com>
[auth]
bitbucket.prefix = bitbucket.org
bitbucket.username = caliChander
bitbucket.password = some_very_long_password_here
bitbucket.schemes = http https
[web]
cacerts = /etc/hg-dummy-cert.pem

我的直觉是密码字段中不允许使用某些字符?这是通过 1Pass 随机生成的。是这样吗?

以防万一,cs1 存储库中的 .hg/hgrc 如下所示:

[paths] default = https://caliChander@bitbucket.org/caliChander/cs1

我在 OS X Mavericks 上。感谢您的帮助!

【问题讨论】:

    标签: mercurial bitbucket hgrc


    【解决方案1】:

    我很好奇为什么它说“密码未设置”

    由于 URL 可能同时包含用户名和密码,所以您的 https://caliChander@bitbucket.org/ 只有用户名部分

    [ui] 部分与 auth-stage 无关(它只是信息数据,用于定义用户数据,显示在本地提交的日志中),只有来自 [auth] 的用户名-密码用于身份验证。您可以在 hgrc 中临时禁用密码并手动输入它

    【讨论】:

    • 是的,手动输入密码有效。任何线索为什么 ~/.hgrc 中包含密码的 auth 部分被忽略?
    • @ChanderRamesh - 如果您使用 正确的前缀(没有用户名),它将不会被忽略 - any 您真实 URL 的前导部分不会'不匹配前缀bitbucket.org。用户名从 URL 中捕获,由于前缀不匹配而未使用密码
    猜你喜欢
    • 1970-01-01
    • 2011-11-20
    • 2010-10-31
    • 2013-02-07
    • 1970-01-01
    • 2020-04-03
    • 2021-06-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多