Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2415 lookup for SqlRoleProvider breaks in ASP.NET identity 2 #2417

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ endif::[]
[[release-notes-1.x]]
=== .NET Agent version 1.x

[[release-notes-1.28.2]]
==== 1.28.2 - 2024/08/14

===== Bug fixes

{pull}2415[#2415] Fixed check for SqlRoleProvider under AspNet Identity 2.

[[release-notes-1.28.1]]
==== 1.28.1 - 2024/08/12

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,9 @@ private void FillSampledTransactionContextUser(HttpContext context, ITransaction
return;

var user = new User { UserName = userIdentity.Name };
var sqlRoleProvider = System.Web.Security.Roles.Providers.Cast<object>().Any(provider => provider.GetType().Name == "SqlRoleProvider");

var sqlRoleProvider =
System.Web.Security.Roles.Enabled && System.Web.Security.Roles.Providers.Cast<object>().Any(provider => provider.GetType().Name == "SqlRoleProvider");
if (!sqlRoleProvider && context.User is ClaimsPrincipal claimsPrincipal)
{
try
Expand Down
Loading