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

[BUG] SqlRoleProvider won't work with AspNet Identity 2 #2415

Closed
allen-hsu-rs opened this issue Aug 14, 2024 · 1 comment · Fixed by #2417
Closed

[BUG] SqlRoleProvider won't work with AspNet Identity 2 #2415

allen-hsu-rs opened this issue Aug 14, 2024 · 1 comment · Fixed by #2417
Labels
bug Something isn't working community triage

Comments

@allen-hsu-rs
Copy link

APM Agent version

The version of the Elastic.Apm nuget package used
1.28.1

Environment

Operating system and version:
windows 11

.NET Framework/Core name and version (e.g. .NET 4.6.2, NET Core 3.1.100) :
.NET 4.7.2

Application Target Framework(s) (e.g. net462, netcoreapp3.1):
net472

Describe the bug

A clear and concise description of what the bug is.
Please see the link here - #2377 (comment)

To Reproduce

Steps to reproduce the behavior:

  1. Create an empty MVC project targeting net472
  2. use this template - https://www.nuget.org/packages/Microsoft.AspNet.Identity.Samples/#readme-body-tab
  3. In Startup.cs - copy and paste following
using Owin;
using System.Linq;

namespace IdentitySample
{
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            try {
			    var providers = System.Web.Security.Roles.Providers;
			    var sqlRoleProvider = System.Web.Security.Roles.Providers.Cast<object>().Any(provider => provider.GetType().Name == "SqlRoleProvider");
            }catch(System.Exception e){
                System.Diagnostics.Debug.WriteLine(e.Message);
            }
            ConfigureAuth(app);
        }
    }
}

Expected behavior

System.Web.Security.Roles.Providers will throw exception in Startup.cs, which will do the same and break SDK as mentioned here - #2377 (comment)

Actual behavior

#2377 (comment)

@Mpdreamz
Copy link
Member

Thank you for bringing this to our attention @allen-hsu-rs !

Opened #2417 to address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants