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

**URL:** <https://community.sonatype.com/t/api-beta-repositories-docker-proxy-authentication-not-working/3721>\
**Category:** Sonatype Nexus Repository\
**Tags:** api\
**Created:** [March 23, 2020, 9:55am UTC](https://community.sonatype.com/t/api-beta-repositories-docker-proxy-authentication-not-working/3721 "2020-03-23T09:55:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ihlavaty.cz](https://avatars.discourse-cdn.com/v4/letter/i/b4bc9f/32.png) [@ihlavaty.cz](https://community.sonatype.com/u/ihlavaty.cz)\
**Post date:** [March 23, 2020, 9:55am UTC](https://community.sonatype.com/t/api-beta-repositories-docker-proxy-authentication-not-working/3721/1 "2020-03-23T09:55:04Z")

</div>

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

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/communitysonatype/original/2X/2/2b89d52be5e2ac50745ae456417f2abafb09bdd9.png)

any hints how to solve it ?

thanks  
Ivo

---

<div class="post-metadata">

**Author:** ![dsawa](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/dsawa/32/729_2.png) [@dsawa](https://community.sonatype.com/u/dsawa)\
**Post date:** [March 23, 2020, 11:10am UTC](https://community.sonatype.com/t/api-beta-repositories-docker-proxy-authentication-not-working/3721/2 "2020-03-23T11:10:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ihlavaty.cz](https://avatars.discourse-cdn.com/v4/letter/i/b4bc9f/32.png) [@ihlavaty.cz](https://community.sonatype.com/u/ihlavaty.cz)\
**Post date:** [March 23, 2020, 1:51pm UTC](https://community.sonatype.com/t/api-beta-repositories-docker-proxy-authentication-not-working/3721/3 "2020-03-23T13:51:44Z")

</div>

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:

```auto
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]}{0.0.0.0:8083}
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]}{0.0.0.0:8083}
```

---

<div class="post-metadata">

**Author:** ![dsawa](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/dsawa/32/729_2.png) [@dsawa](https://community.sonatype.com/u/dsawa)\
**Post date:** [March 24, 2020, 11:21am UTC](https://community.sonatype.com/t/api-beta-repositories-docker-proxy-authentication-not-working/3721/4 "2020-03-24T11:21:12Z")

</div>

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](https://github.com/sonatype/nexus-public/pull/63)  
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.

---

<div class="post-metadata">

**Author:** ![ihlavaty.cz](https://avatars.discourse-cdn.com/v4/letter/i/b4bc9f/32.png) [@ihlavaty.cz](https://community.sonatype.com/u/ihlavaty.cz)\
**Post date:** [March 24, 2020, 11:50am UTC](https://community.sonatype.com/t/api-beta-repositories-docker-proxy-authentication-not-working/3721/5 "2020-03-24T11:50:54Z")

</div>

> [@dsawa](#):
>
> around 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
