dotnet / systemweb-adapters

MIT License
332 stars 58 forks source link

Roles are not converted to Claims on Login #505

Open tsi-kyle opened 1 month ago

tsi-kyle commented 1 month ago

Describe the bug

Currently, I have Remote Auth setup using SystemWebAdapters. Going from .net 4.7.2 MVC using Simple Membership with default setup to .NET 8.

.NET 8 image

Forms: image

Everything is working with Authorization, it logs me in and logs me out and I can tell when a user is logged in just fine. However on the Framework side I have like 85 roles and on the .NET side I have only 1 claim for my username.

image

After a discussion in this thread: https://github.com/dotnet/systemweb-adapters/issues/331 I tested manually casing my user to a claims principal and that seems to work fine, as you can see I have all of my roles:

image

So what I want to know is should systemwebadapters be converting my roles automatically or do I need to do some extra configuration for that to work. From what I was reading, it seem like this should work automatically for all of the old out of the box authentications in MVC so I'm not sure why this one isn't working.

Further technical details

Please include the following if applicable:

ASP.NET Framework Application:

ASP.NET Core Application: