# Registry v2 - Token Auth example

**URL:** <https://forums.docker.com/t/registry-v2-token-auth-example/1391>\
**Category:** Open Source Registry API\
**Created:** [April 28, 2015, 4:37am UTC](https://forums.docker.com/t/registry-v2-token-auth-example/1391 "2015-04-28T04:37:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccamporesi](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@ccamporesi](https://forums.docker.com/u/ccamporesi)\
**Post date:** [April 28, 2015, 4:37am UTC](https://forums.docker.com/t/registry-v2-token-auth-example/1391/1 "2015-04-28T04:37:20Z")

</div>

Hello,

I have been playing around with the new docker registry v2 lately and I was wondering if there is a more exhaustive documentation (or examples) on how to configure the private registry v2 to use the Token Authentication than the one in the website or in GitHub.

Any help is appreciated and Thanks for the great work!

C

---

<div class="post-metadata">

**Author:** ![danackerson](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/danackerson/32/975_2.png) [@danackerson](https://forums.docker.com/u/danackerson)\
**Post date:** [April 28, 2015, 9:47am UTC](https://forums.docker.com/t/registry-v2-token-auth-example/1391/2 "2015-04-28T09:47:17Z")

</div>

Hi Carlo,

would you happen to have the Registry v2 endpoint? I’m unable to find this anywhere and get stuck @ “[https://registry.hub.docker.com/v2/](https://registry.hub.docker.com/v2/) does not appear to be a v2 registry endpoint”…

Thanks,

Dan

---

<div class="post-metadata">

**Author:** ![ccamporesi](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@ccamporesi](https://forums.docker.com/u/ccamporesi)\
**Post date:** [April 28, 2015, 4:21pm UTC](https://forums.docker.com/t/registry-v2-token-auth-example/1391/3 "2015-04-28T16:21:47Z")

</div>

Hey Dan,

I am not sure docker hub is already supporting the new API. I did not test it yet. I have been deploying the private registry docker container in my cluster and accessing it.  
Here is the link to the documentation:

> **[Deploy a registry server](https://docs.docker.com/registry/deploying/)**
>
> Before you can deploy a registry, you need to install Docker on the host. A registry is an instance of the registry image, and runs within Docker. This topic provides...

if you do HTTP requests through curl or a web browser http(s)://:5000/v2/ you can get the API of the container.

Hope this helps,

C

---

<div class="post-metadata">

**Author:** ![danackerson](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/danackerson/32/975_2.png) [@danackerson](https://forums.docker.com/u/danackerson)\
**Post date:** [April 28, 2015, 4:35pm UTC](https://forums.docker.com/t/registry-v2-token-auth-example/1391/4 "2015-04-28T16:35:13Z")

</div>

indeed: “Scott Johnston, SVP of Product, Docker, Inc, told ServerWatch that the plan is to transition Docker Hub to Registry 2.0 later in April.” (from [http://www.serverwatch.com/server-news/docker-engine-1.6-debuts-alongside-docker-registry-2.0-and-compose-1.2.0.html](http://www.serverwatch.com/server-news/docker-engine-1.6-debuts-alongside-docker-registry-2.0-and-compose-1.2.0.html))…

Thanks for getting my head out of the sand, Carlo!

---

<div class="post-metadata">

**Author:** ![megadeezl](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/megadeezl/32/1390_2.png) [@megadeezl](https://forums.docker.com/u/megadeezl)\
**Post date:** [July 26, 2015, 3:09am UTC](https://forums.docker.com/t/registry-v2-token-auth-example/1391/5 "2015-07-26T03:09:59Z")

</div>

Hello Carlo,  
Were you able to utilize token auth feature? I’m close, but it seems the token I’m generating isn’t exactly what the registry is looking for.

---

<div class="post-metadata">

**Author:** ![deitch](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/deitch/32/10682_2.png) [@deitch](https://forums.docker.com/u/deitch)\
**Post date:** [May 27, 2016, 9:58am UTC](https://forums.docker.com/t/registry-v2-token-auth-example/1391/6 "2016-05-27T09:58:04Z")

</div>

A year later, but did either of you get it? I ended up implementing my own token auth lib in both go and ruby. If you want the links, ask here.

---

<div class="post-metadata">

**Author:** ![colemanserious](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/colemanserious/32/13468_2.png) [@colemanserious](https://forums.docker.com/u/colemanserious)\
**Post date:** [September 7, 2016, 7:14pm UTC](https://forums.docker.com/t/registry-v2-token-auth-example/1391/7 "2016-09-07T19:14:05Z")

</div>

Would love the links…

Thanks…

---

<div class="post-metadata">

**Author:** ![deitch](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/deitch/32/10682_2.png) [@deitch](https://forums.docker.com/u/deitch)\
**Post date:** [September 7, 2016, 7:19pm UTC](https://forums.docker.com/t/registry-v2-token-auth-example/1391/8 "2016-09-07T19:19:54Z")

</div>

With pleasure. Here [https://github.com/deitch/docker\_registry2](https://github.com/deitch/docker_registry2)

I have branches open on my laptop to add pulls and pushes as well. No reason to need to talk to a docker engine daemon to pull and push when it is just an image. Also, if you are relabelling, e.g. pull-tag-push, that whole thing can be done via API.

But the client I was working with on it didn’t have need for those features, so I ran out of time. Would love to add those as well, when someone is ready.
