# Logging userlist username

**URL:** <https://discourse.haproxy.org/t/logging-userlist-username/197>\
**Category:** Help!\
**Created:** [March 29, 2016, 12:35am UTC](https://discourse.haproxy.org/t/logging-userlist-username/197 "2016-03-29T00:35:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbweber](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/jbweber/32/57_2.png) [@jbweber](https://discourse.haproxy.org/u/jbweber)\
**Post date:** [March 29, 2016, 12:35am UTC](https://discourse.haproxy.org/t/logging-userlist-username/197/1 "2016-03-29T00:35:26Z")

</div>

I have setup haproxy to use a userlist and groups to add basic authentication to a local service which doesn’t have this functionality. Everything is working as expected, but I don’t see how to capture the username that was authenticated so I can add it to the logs. Is this possible to do?

---

<div class="post-metadata">

**Author:** ![Baptiste](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Baptiste](https://discourse.haproxy.org/u/Baptiste)\
**Post date:** [March 29, 2016, 6:36am UTC](https://discourse.haproxy.org/t/logging-userlist-username/197/2 "2016-03-29T06:36:50Z")

</div>

Well, we need a converter to decode base64 and it currently does not exist. We may write one, doesn’t sound that complicated.

There is a dirty workaround: store in a map file the content of the Authorization header encoded in base 64 as the key and the user name as the value.  
Then you would be able to do

```
%[req.hdr(Authorization),map(your_map_file.map)]

```

And your mapfile would contain something like:

```
YWRtaW46YWRtaW4K admin
dXNlcjE6bXlwYXNzd29yZAo= user1

```

etc…
