# Steps required to implement basic auth?

**URL:** <https://community.traefik.io/t/steps-required-to-implement-basic-auth/2978>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [November 16, 2019, 5:09pm UTC](https://community.traefik.io/t/steps-required-to-implement-basic-auth/2978 "2019-11-16T17:09:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adxnq7XcziaJ9H](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Adxnq7XcziaJ9H](https://community.traefik.io/u/Adxnq7XcziaJ9H)\
**Post date:** [November 16, 2019, 5:09pm UTC](https://community.traefik.io/t/steps-required-to-implement-basic-auth/2978/1 "2019-11-16T17:09:44Z")

</div>

I'm clearly missing something. I've looked at the documentation [here](https://docs.traefik.io/v2.0/middlewares/basicauth/#configuration-examples) and as far as I can tell it looks like all I need to do is add this line to my `labels` section (I'm using docker-compose)

```auto
      - "traefik.http.middlewares.heimdall.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"

```

But it doesn't seem to work. What am I missing?

```auto

```

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [November 16, 2019, 6:20pm UTC](https://community.traefik.io/t/steps-required-to-implement-basic-auth/2978/2 "2019-11-16T18:20:14Z")

</div>

Hello,

you have reference the middleware on the router:

```auto
- "traefik.http.routers.yourouter.middlewares=heimdall"

```

- [https://docs.traefik.io/v2.0/routing/routers/#middlewares](https://docs.traefik.io/v2.0/routing/routers/#middlewares)
- [https://docs.traefik.io/v2.0/routing/providers/docker/#routers](https://docs.traefik.io/v2.0/routing/providers/docker/#routers)
