diff --git a/src/integrations/Elastic.Apm.AspNetFullFramework/Elastic.Apm.AspNetFullFramework.csproj b/src/integrations/Elastic.Apm.AspNetFullFramework/Elastic.Apm.AspNetFullFramework.csproj index b25a0dce4..e05324f00 100644 --- a/src/integrations/Elastic.Apm.AspNetFullFramework/Elastic.Apm.AspNetFullFramework.csproj +++ b/src/integrations/Elastic.Apm.AspNetFullFramework/Elastic.Apm.AspNetFullFramework.csproj @@ -18,6 +18,7 @@ + diff --git a/src/integrations/Elastic.Apm.AspNetFullFramework/ElasticApmModule.cs b/src/integrations/Elastic.Apm.AspNetFullFramework/ElasticApmModule.cs index ef767aa47..26febdbf6 100644 --- a/src/integrations/Elastic.Apm.AspNetFullFramework/ElasticApmModule.cs +++ b/src/integrations/Elastic.Apm.AspNetFullFramework/ElasticApmModule.cs @@ -631,8 +631,8 @@ private void FillSampledTransactionContextUser(HttpContext context, ITransaction return; var user = new User { UserName = userIdentity.Name }; - - if (context.User is ClaimsPrincipal claimsPrincipal) + var sqlRoleProvider = System.Web.Security.Roles.Providers.Cast().Any(provider => provider.GetType().Name == "SqlRoleProvider"); + if (!sqlRoleProvider && context.User is ClaimsPrincipal claimsPrincipal) { try {