# Error parsing BasicUser with traefikv2

**URL:** <https://community.traefik.io/t/error-parsing-basicuser-with-traefikv2/5785>\
**Category:** Traefik v2\
**Tags:** middleware\
**Created:** [April 29, 2020, 2:09am UTC](https://community.traefik.io/t/error-parsing-basicuser-with-traefikv2/5785 "2020-04-29T02:09:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Orwill](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/orwill/32/1671_2.png) [@Orwill](https://community.traefik.io/u/Orwill)\
**Post date:** [April 29, 2020, 2:09am UTC](https://community.traefik.io/t/error-parsing-basicuser-with-traefikv2/5785/1 "2020-04-29T02:09:13Z")

</div>

Using traefik with kubernetes.

bauth.yaml:

```auto
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: bauth
spec:
  basicAuth:
    secret: bauth
    headerField: X-WebAuth-User
    removeHeader: true

```

auth-secret.yaml:

```auto
apiVersion: v1
kind: Secret
metadata:
  name: bauth
data:
  users: b3J3aWxsJTNBJTI0YXByMSUyNDdrbnprYW96JTI0dTR3WU1SYXgwYzRmUVFKRndTZ2VZMQ==

```

ingressroute:

```auto
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: dashboard
  namespace: kube-system
spec:
  entryPoints:
    - web
    - websecure
  routes:
    - match: Host(`xxx.xxx.xxx`)
      kind: Rule
      services:
        - name: api@internal
          kind: TraefikService
      middlewares:
        - name: default-http2s@kubernetescrd
        - name: default-bauth@kubernetescrd
  tls:
    secretName: xxx-xxx-prod

```

error log:

```auto
time="2020-04-29T02:01:49Z" level=info msg="Configuration loaded from flags."
time="2020-04-29T02:01:50Z" level=error msg="error parsing BasicUser: orwill%3A%24apr1%247knzkaoz%24u4wYMRax0c4fQQJFwSgeY1" entryPointName=web routerName=kube-system-dashboard-285d9fd39c3b4ad05b9c@kubernetescrd
time="2020-04-29T02:01:50Z" level=error msg="error parsing BasicUser: orwill%3A%24apr1%247knzkaoz%24u4wYMRax0c4fQQJFwSgeY1" entryPointName=websecure routerName=kube-system-dashboard-285d9fd39c3b4ad05b9c@kubernetescrd

```

---

<div class="post-metadata">

**Author:** ![notsureifkevin](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/notsureifkevin/32/1940_2.png) [@notsureifkevin](https://community.traefik.io/u/notsureifkevin)\
**Post date:** [April 29, 2020, 3:52pm UTC](https://community.traefik.io/t/error-parsing-basicuser-with-traefikv2/5785/2 "2020-04-29T15:52:03Z")

</div>

> [@Orwill](#):
>
> b3J3aWxsJTNBJTI0YXByMSUyNDdrbnprYW96JTI0dTR3WU1SYXgwYzRmUVFKRndTZ2VZMQ==

I've decoded this and it appears the format is incorrect. You may be URL encoding this string before passing it into your secret handler. The decoded version of this string is:

`orwill%3A%24apr1%247knzkaoz%24u4wYMRax0c4fQQJFwSgeY1`

when it should be:

`orwill:$apr1$7knzkaoz$u4wYMRax0c4fQQJFwSgeY1`

How are you handling this string before it's created as a secret?
