diff --git a/apiserver/grpcserver/discover/v1/client_access.go b/apiserver/grpcserver/discover/v1/client_access.go index 89a3d5d19..a190d383c 100644 --- a/apiserver/grpcserver/discover/v1/client_access.go +++ b/apiserver/grpcserver/discover/v1/client_access.go @@ -144,6 +144,10 @@ func (g *DiscoverServer) Discover(server apiservice.PolarisGRPC_DiscoverServer) }) }() + if in.GetService().GetToken().GetValue() != "" { + ctx = context.WithValue(ctx, utils.ContextAuthTokenKey, in.GetService().GetToken().GetValue()) + } + switch in.Type { case apiservice.DiscoverRequest_INSTANCE: action = metrics.ActionDiscoverInstance