diff --git a/internal/auth/sasl.go b/internal/auth/sasl.go index 8c67073..02783a2 100644 --- a/internal/auth/sasl.go +++ b/internal/auth/sasl.go @@ -66,9 +66,12 @@ func (s *SASLAuth) SASLMechanisms() []string { } func (s *SASLAuth) usernameForAuth(ctx context.Context, saslUsername string) (string, error) { - saslUsername, err := s.AuthNormalize(saslUsername) - if err != nil { - return "", err + if s.AuthNormalize != nil { + var err error + saslUsername, err = s.AuthNormalize(saslUsername) + if err != nil { + return "", err + } } if s.AuthMap == nil {