Docker registry auth with Postman

60 Views Asked by At

I am trying to authenticate to my Docker Registry with Postman (with docker login everything works fine). This registry has registry-auth to provide Bearer token authentication. When I use GET to url https://my-registry/v2/_catalog, I get 401 and header Www-authenicate: Bearer realm="https://my-registry/auth",service="Docker registry",scope="registry:catalog:*", so then I go to this URL https://my-registry/auth with basic auth and get access token:

{"access_token":"...","token":"..."}

But this token does not contain audience: enter image description here

And when I am trying to auth to registry with this token (Bearer authorization) a get an error:

time="2024-02-14T12:28:01.94390047Z" level=info msg="token intended for another audience: """
time="2024-02-14T12:28:01.944526841Z" level=warning msg="error authorizing context: invalid token" go.version=go1.20.8 http.request.host=registry http.request.id=efa95ede-a2c6-47f4-ac9a-634a9f0086a4 http.request.method=GET http.request.remoteaddr="ip:24982" http.request.uri="/v2/_catalog" http.request.useragent="PostmanRuntime/7.36.1"
ip - - [14/Feb/2024:12:28:01 +0000] "GET /v2/_catalog HTTP/1.1" 401 145 "" "PostmanRuntime/7.36.1"

It seems to me that I am doing the second step (getting token from /auth) somehow wrong. Where am I wrong? How should I authenticate to Docker registry with Postman?

0

There are 0 best solutions below