# Middleware basic auth secret format

**URL:** <https://community.traefik.io/t/middleware-basic-auth-secret-format/8047>\
**Category:** Traefik v2\
**Tags:** middleware\
**Created:** [October 5, 2020, 6:42am UTC](https://community.traefik.io/t/middleware-basic-auth-secret-format/8047 "2020-10-05T06:42:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SayakMukhopadhyay](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/sayakmukhopadhyay/32/2671_2.png) [@SayakMukhopadhyay](https://community.traefik.io/u/SayakMukhopadhyay)\
**Post date:** [October 5, 2020, 6:42am UTC](https://community.traefik.io/t/middleware-basic-auth-secret-format/8047/1 "2020-10-05T06:42:26Z")

</div>

Hi

I am planning to add a basic auth middleware to traefik in k8s and as such I am following the guide at [https://doc.traefik.io/traefik/middlewares/basicauth/](https://doc.traefik.io/traefik/middlewares/basicauth/). In here the example secret for storing the username:password is as such

```auto
apiVersion: v1
kind: Secret
metadata:
  name: authsecret
  namespace: default

data:
  users: |2
    dGVzdDokYXByMSRINnVza2trVyRJZ1hMUDZld1RyU3VCa1RycUU4d2ovCnRlc3QyOiRhcHIxJGQ5
    aHI5SEJCJDRIeHdnVWlyM0hQNEVzZ2dQL1FObzAK

```

I can get the base64 encoded part and I can see that 2 usernames and passwords are defined. But what is the "2" for?

---

<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:** [October 5, 2020, 7:23am UTC](https://community.traefik.io/t/middleware-basic-auth-secret-format/8047/2 "2020-10-05T07:23:30Z")

</div>

Hello,

the `2` is the indentation indicator: [https://yaml.org/spec/1.2/spec.html#id2793979](https://yaml.org/spec/1.2/spec.html#id2793979)

---

<div class="post-metadata">

**Author:** ![SayakMukhopadhyay](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/sayakmukhopadhyay/32/2671_2.png) [@SayakMukhopadhyay](https://community.traefik.io/u/SayakMukhopadhyay)\
**Post date:** [October 5, 2020, 8:45am UTC](https://community.traefik.io/t/middleware-basic-auth-secret-format/8047/3 "2020-10-05T08:45:58Z")

</div>

Ah of course. The fact that the encoded secret had 2 username passwords threw me off. Thanks a lot for the quick reply!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [October 8, 2020, 8:45am UTC](https://community.traefik.io/t/middleware-basic-auth-secret-format/8047/4 "2020-10-08T08:45:59Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
