diff --git a/flyteadmin/auth/handlers.go b/flyteadmin/auth/handlers.go index 0416245f8c..a6220db6e3 100644 --- a/flyteadmin/auth/handlers.go +++ b/flyteadmin/auth/handlers.go @@ -260,9 +260,10 @@ func GetAuthenticationCustomMetadataInterceptor(authCtx interfaces.Authenticatio if authCtx.Options().GrpcAuthorizationHeader != DefaultAuthorizationHeader { md, ok := metadata.FromIncomingContext(ctx) if ok { - existingHeader := md.Get(authCtx.Options().GrpcAuthorizationHeader) + grpcAuthzHeader := authCtx.Options().GrpcAuthorizationHeader + existingHeader := md.Get(grpcAuthzHeader) if len(existingHeader) > 0 { - logger.Debugf(ctx, "Found existing metadata %s", existingHeader[0]) + logger.Debugf(ctx, "Found existing metadata header %s", grpcAuthzHeader) newAuthorizationMetadata := metadata.Pairs(DefaultAuthorizationHeader, existingHeader[0]) joinedMetadata := metadata.Join(md, newAuthorizationMetadata) newCtx := metadata.NewIncomingContext(ctx, joinedMetadata)