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

curl UNAUTHORIZED #99

Open
christopherwoo opened this issue Jan 19, 2019 · 5 comments
Open

curl UNAUTHORIZED #99

christopherwoo opened this issue Jan 19, 2019 · 5 comments

Comments

@christopherwoo
Copy link

curl UNAUTHORIZED

I run docker-compose.yml in docker-registry-web/examples/auth-enabled, and everything work fine.
Now I have thoudsands of images to prune, and I choose not to delete them one by one using Web UI.
I want to try a script contains curl command, but when runing

curl ipaddress:5000/v2/_catalog

I got

{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"registry","Name":"catalog","Action":"*"}]}]}

How to get auth and run curl ?

@christopherwoo
Copy link
Author

My configuration

cat conf/registry/config.yml
version: 0.1

storage:
  filesystem:
    rootdirectory: /registry
  delete:
    enabled: true
    
http:
  addr: 0.0.0.0:5000    

auth:
  token:
    #realm: http://localhost:8080/api/auth
    #service: localhost:5000
    realm: http://ipaddress:8080/api/auth
    service: ipaddress:5000
    issuer: test
    rootcertbundle: /etc/docker/registry/auth.cert

log:
  level: info
  
notifications:
  endpoints:
    - name: listener
      url: http://registry-web:8080/api/notification
      timeout: 500ms
      threshold: 5
      backoff: 1s

ipaddress is a lan ip address.

@christopherwoo
Copy link
Author

I see now how to get token (GET http://ipaddress:8080/api/auth), but still confuse how to use token in curl.

@Cronist
Copy link

Cronist commented Apr 4, 2023

I am facing the same issue. how can I do it?

@s3bul
Copy link

s3bul commented Apr 4, 2023

I am facing the same issue. how can I do it?

https://www.arthurkoziel.com/dockerhub-registry-api/ ?

@Cronist
Copy link

Cronist commented Apr 4, 2023

I am facing the same issue. how can I do it?

https://www.arthurkoziel.com/dockerhub-registry-api/ ?

thank you so much for your reply.

but the link is not working with the docker-registry-web auth.
I mean even if you will send like that

curl -s -H "Content-Type: application/json" -X POST -d '{"j_username": "exiting_username", "j_password": "real_password"}' https:///api/auth](http://ipaddress:8080/api/auth

OR

curl -s -H "Content-Type: application/json" -X POST -d '{"username": "exiting_username", "password": "real_password"}' https:///api/auth](http://ipaddress:8080/api/auth

the answer is

No auth

So I am still looking for a solution to obtain a TOKEN from docker-regitry-web via wget or curl.

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

3 participants