API /beta/repositories/docker/proxy authentication not working

Hi all,
I was trying to set up new PROXY repository via API on Nexus .3.21.1 . Everything works except for Authentication section for HTTP. API example mixes Username and NTLM examples.
“authentication”: {
“type”: “username”,
“username”: “string”,
“ntlmHost”: “string”,
“ntlmDomain”: “string”

Here is the debug output with payload sent via POST/PUT method

any hints how to solve it ?


Hi Ivo, sorry, but I’m not sure what is the issue you’re having. The screenshot you attached looks like a request that you sent, not the output. Can you post here the request you’re sending, response you’re getting and NXRM logs? I can’t see any error you’re getting. As for the example mixing both authentication methods - you’re right, the example mixes them as we can only provide one example in Swagger and we hope users can figure out what they need to set with help of error messages if there are any error in provided config.

Hi Dawid,
thanks for such quick answer. Error is that the Authentication section is ignored. Even If I set it manually via WEB UI, it is wiped after applying setting via API.

API call returns 2xx code, no error.
Here is the log from Nexus:

2020-03-23 13:48:22,279+0000 INFO  [qtp1876725918-2993]  admin org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl - Updating repository: myrepo -> OrientConfiguration{repositoryName='myrepo', recipeName='docker-proxy', attributes={proxy={contentMaxAge=5, metadataMaxAge=5, remoteUrl=https://nexus.mycomp.com}, negativeCache={timeToLive=1, enabled=false}, dockerProxy={indexType=REGISTRY}, storage={strictContentTypeValidation=true, blobStoreName=default}, httpclient={blocked=false, autoBlock=false, connection={authentication={password=****, type=username, username=admin}}}, docker={httpPort=8083, v1Enabled=true, forceBasicAuth=true}}}
2020-03-23 13:48:22,283+0000 INFO  [qtp1876725918-2993]  admin org.sonatype.nexus.internal.jetty.ConnectorRegistrarImpl - Removing connector configuration DockerConnectorConfiguration{repositoryName=myrepo, scheme=http, port=8083}
2020-03-23 13:48:22,286+0000 INFO  [qtp1876725918-2993]  admin org.eclipse.jetty.server.AbstractConnector - Stopped ServerConnector@5ff3b7ce{HTTP/1.1,[http/1.1]}{}
2020-03-23 13:48:22,289+0000 INFO  [qtp1876725918-2993]  admin org.sonatype.nexus.repository.httpclient.internal.HttpClientFacetImpl - Remote connection status of repository myrepo set to Ready to Connect.
2020-03-23 13:48:22,290+0000 INFO  [qtp1876725918-2993]  admin org.sonatype.nexus.internal.jetty.ConnectorRegistrarImpl - Adding connector configuration DockerConnectorConfiguration{repositoryName=myrepo, scheme=http, port=8083}
2020-03-23 13:48:22,291+0000 WARN  [qtp1876725918-2993]  admin org.eclipse.jetty.server.AbstractConnector - Ignoring deprecated socket close linger time
2020-03-23 13:48:22,294+0000 INFO  [qtp1876725918-2993]  admin org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@72350973{HTTP/1.1,[http/1.1]}{}

Looks like this is an issue that was discovered here: Fix proxy API request converter for http client auth by jonesbusy · Pull Request #63 · sonatype/nexus-public · GitHub
The only workaround is to use the UI, but as you noticed any further changes via REST will wipe authentication config - we’ll try to ship the fix in next release.

Thanks Dawid