# Use another header than Authorization for basic auth

**URL:** <https://community.traefik.io/t/use-another-header-than-authorization-for-basic-auth/8845>\
**Category:** Traefik v2\
**Tags:** middleware\
**Created:** [December 2, 2020, 3:45pm UTC](https://community.traefik.io/t/use-another-header-than-authorization-for-basic-auth/8845 "2020-12-02T15:45:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![emex](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/emex/32/2986_2.png) [@emex](https://community.traefik.io/u/emex)\
**Post date:** [December 2, 2020, 3:45pm UTC](https://community.traefik.io/t/use-another-header-than-authorization-for-basic-auth/8845/1 "2020-12-02T15:45:01Z")

</div>

Hi there,

I have an api using basic auth behind Traefik and i would like to add an authentication at Traefik level.  
I succeeded in configuring basic auth at Traefik level using the basic auth middleware, but i want the credentials for authenticating at Traefik level to be different than at app level (some kind of MFA) and i only have one possible Authorization header to hold them both.  
The solution i was hoping from Traefik basic auth middleware is to be able to define a specific header to be used for authentication, but looking at the doc and the source code, it seems it's not possible at the moment.  
I guess [https://github.com/traefik/traefik/blob/master/pkg/middlewares/auth/basic\_auth.go#L65](https://github.com/traefik/traefik/blob/master/pkg/middlewares/auth/basic_auth.go#L65) would have to be updated to get the authorization from a specific header.

Do you have any suggestion how i could achieve this?

Thanks,  
MX
