Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login failed for local HTTPS registry #862

Open
Skarlso opened this issue Dec 19, 2024 · 0 comments
Open

Login failed for local HTTPS registry #862

Skarlso opened this issue Dec 19, 2024 · 0 comments

Comments

@Skarlso
Copy link

Skarlso commented Dec 19, 2024

Hello. I have a local registry with username password setup.

I tried ORAS to log in using the library and the CLI. Both failed. Whereas crane is succeeding with the login.

host:  py-test.local
certs:  {ocmuser ocmpass  }
Error: ocm.software/podinfo:1.0.7: creating target version: failed to resolve manifest "py-test.local/component-descriptors/ocm.software/podinfo:1.0.7": HEAD "https://py-test.local/v2/component-descriptors/ocm.software/podinfo/manifests/1.0.7": response status code 401: Unauthorized

with crane CLI

➜ crane auth login py-test.local --username ocmuser --password ocmpass
2024/12/19 17:48:43 logged in via /Users/skarlso/.docker/config.json

with oras cli

❯ oras login py-test.local --debug
Username: ocmuser
Password:
DEBU[0005] Request #0
> Request URL: "https://py-test.local/v2/"
> Request method: "GET"
> Request headers:
   "User-Agent": "oras/1.2.0+Homebrew"
DEBU[0010] Response #0
< Response Status: "401 Unauthorized"
< Response headers:
   "Docker-Distribution-Api-Version": "registry/2.0"
   "Www-Authenticate": "Basic realm=\"Registry Realm\""
   "X-Content-Type-Options": "nosniff"
   "Content-Length": "87"
   "Date": "Thu, 19 Dec 2024 16:50:10 GMT"
   "Content-Type": "application/json; charset=utf-8"
DEBU[0010] Request #1
> Request URL: "https://py-test.local/v2/"
> Request method: "GET"
> Request headers:
   "User-Agent": "oras/1.2.0+Homebrew"
   "Authorization": "*****"
DEBU[0010] Response #1
< Response Status: "401 Unauthorized"
< Response headers:
   "Www-Authenticate": "Basic realm=\"Registry Realm\""
   "X-Content-Type-Options": "nosniff"
   "Content-Length": "87"
   "Date": "Thu, 19 Dec 2024 16:50:10 GMT"
   "Content-Type": "application/json; charset=utf-8"
   "Docker-Distribution-Api-Version": "registry/2.0"
Error response from registry: failed to validate the credentials for py-test.local: unauthorized: authentication required
ocm on  main [$!?] via 🐹 v1.23.2 via 🐍 v3.13.0 (oras-oci-python-test) on ☁️   [email protected] took 10s
❯ docker ps
CONTAINER ID   IMAGE            COMMAND                  CREATED          STATUS          PORTS                            NAMES
453acb9b7160   registry:2.8.1   "/entrypoint.sh /etc…"   20 minutes ago   Up 20 minutes   0.0.0.0:443->443/tcp, 5000/tcp   registry
ime="2024-12-19T16:50:10.773189883Z" level=warning msg="error authorizing context: basic authentication challenge for realm "Registry Realm": authentication failure" go.version=go1.16.15 http.request.host=py-test.local http.request.id=8c10999b-4748-42b7-8150-aabf9eaabf22 http.request.method=GET http.request.remoteaddr="172.17.0.1:58074" http.request.uri="/v2/" http.request.useragent="oras/1.2.0+Homebrew"
172.17.0.1 - - [19/Dec/2024:16:50:10 +0000] "GET /v2/ HTTP/2.0" 401 87 "" "oras/1.2.0+Homebrew"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant