Misleading "incorrect username or password" error with an HTTP token realm (Harbor)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- docker, kubernetes, linux, macos, nginx, rust
- Domain
- authentication, devtools, security
Research direction
The insecure-realm check lives in the registry authentication code of the Rust project; start by searching for where the WWW-Authenticate Bearer realm is parsed and where credentials are refused for non-HTTPS realms. Reproduce with a mock registry that returns a plain-HTTP realm and confirm the surfaced message. Done when the error names the insecure token realm instead of reporting incorrect credentials, and the existing auth tests still pass.
Written by the indexing model from the issue text.
Description
Description
docker login reports incorrect credentials when a Harbor registry behind an HTTPS reverse proxy advertises an HTTP token realm. Docker Desktop login succeeds, and Kiri pull/push also worked using existing credentials. Kiri login to demo.goharbor.io succeeds.
Environment
Harbor 2.13.2, Nginx reverse proxy with a Let's Encrypt certificate. The registry is accessed via HTTPS.
Reproduction
docker --context kiri login harbor.example.com -u testuser
Actual error:
Error response from daemon: unauthorized: incorrect username or password
Inspect the registry challenge:
curl -sS -D - -o /dev/null https://harbor.example.com/v2/
WWW-Authenticate: Bearer realm="http://harbor.example.com:8091/service/token",service="harbor-registry"
Confirmed solution
Set the public HTTPS URL in harbor.yml:
external_url: https://harbor.example.com
Regenerate the configuration with ./prepare and restart Harbor. Kiri login then succeeds.
Suggestion
Refusing to send credentials over plain HTTP is correct. However, the password error is misleading. Please explicitly report the insecure token realm and, if useful, document the Harbor external_url fix.
I noticed that the current main branch already appears to return a more specific error for insecure realms. If this is already fixed, feel free to close this issue; I wanted to leave a searchable record of the cause and solution for other Harbor users.
- Dominant language
- Rust
- Stars
- 7.5k
- Forks
- 329
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 347
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from libracoder/kiri
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
libracoder/kiri#935 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
libracoder/kiri#934 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
libracoder/kiri#878 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
libracoder/kiri#936 · 1 reaction ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 22/100
libracoder/kiri#932 ·
Maintainers usually reply within 1 day
Similar issues
-
[Bug] StreamLifecycleConfig clamps post-TTFT stream timeouts to remaining admission budgetPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
lbjlaq/Antigravity-Manager#4063 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
farion1231/cc-switch#9981 · 2 comments ·
Maintainers usually reply within 1 day
-
Windows unit tests fail on main: pnpm-registry-overrides fixtures are checked out as CRLF (mixes CRLF and LF line endings)Possibly taken @mikolalysenko claimed this today. Openagent:claimed agent:triaged ci-janitor priority:p1
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
SocketDev/socket-patch#2238 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bot:ai-assisted component:indexer status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
midnightntwrk/midnight-indexer#1834 ·
Maintainers usually reply within 1 day