dotnet / dotnet/systemweb-adapters

Roles are not converted to Claims on Login

Open
#505 2 comments 1 reaction 0 assignees View on GitHub
Needs: Triage :mag:
Dominant language
C#
Stars
384
Forks
76
Avg merge
2h 24m
Merged PRs (30d)
1

Description

### 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](https://github.com/dotnet/systemweb-adapters/assets/127792741/e9448b68-8cb9-4b03-b7cc-8dcc34743716)

Forms:
![image](https://github.com/dotnet/systemweb-adapters/assets/127792741/5ffcb146-fb46-46e8-a6aa-f2999a56c894)

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](https://github.com/dotnet/systemweb-adapters/assets/127792741/28aa9745-76dd-4217-b19b-8d4e08c6f925)

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](https://github.com/dotnet/systemweb-adapters/assets/127792741/199d8c4e-3522-4345-80d6-d3914b898b05)

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*:
- MVC
- .NET Framework Version: 4.7.2
- IIS Version:
- Windows Version: 11

*ASP.NET Core Application*:
- Targeted .NET version: 8

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.