1
0
Fork 0

Basic Auth custom realm

This commit is contained in:
Thibault Coupin 2018-10-04 16:46:03 +02:00 committed by Traefiker Bot
parent f9689d1562
commit 1431ac5751
15 changed files with 90 additions and 3 deletions

View file

@ -45,8 +45,11 @@ func NewAuthenticator(authConfig *types.Auth, tracingMiddleware *tracing.Tracing
if err != nil {
return nil, err
}
basicAuth := goauth.NewBasicAuthenticator("traefik", authenticator.secretBasic)
realm := "traefik"
if authConfig.Basic.Realm != "" {
realm = authConfig.Basic.Realm
}
basicAuth := goauth.NewBasicAuthenticator(realm, authenticator.secretBasic)
tracingAuth.handler = createAuthBasicHandler(basicAuth, authConfig)
tracingAuth.name = "Auth Basic"
tracingAuth.clientSpanKind = false