question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add clear documentation about claims type mapping

See original GitHub issue

The original issue got closed without any useful resolution.

I understand the reluctance to make a breaking change (turning off mapping by default), but it should at least be clearly documented in a warning box in the documentation in one of the sections on authorization!!!

Edit: as an example, this page https://docs.microsoft.com/en-us/aspnet/core/security/authorization/claims?view=aspnetcore-2.2 shows how to require “EmployeeNumber” claim. When I paste my token in jwt.ms, it displays “scp” as the scope name. Then I added the code below, and did it work? NO!


From the original post.

Seriously, closed? I just lost two days trying to get the following to work

                opts.AddPolicy("ProjectAccessScope", policy => {
                    policy.RequireClaim("scp", Components.AppScopes.ProjectMember);
                });

It was constantly failing, I had to turn off policy-based authorization and inspect the token manually to discover that it has been renamed. And where is renaming of token types mentioned in the aspnet.core documentation? NOWHERE!

_Originally posted by @zvrba in https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/415#issuecomment-507764708_

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
brentschmaltzcommented, Jul 12, 2019

@zvrba @GeoK i’ll work on a wiki page that asp.net can link to if they choose. I agree this whole mapping issue is complicated.

1reaction
GeoKcommented, Jul 8, 2019

@zvrba - Thank you for raising this issue and for the suggestions. I’ll add this item as one of task for the next milestone.

To answer your other question, ClaimTypes class belongs to System.Security.Claims assembly which ships independently of IdentityModel extensions for .Net assemblies. The complete mapping of claim types is available here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mapping, customizing, and transforming claims in ASP. ...
Learn how to map claims, do claims transformations, customize claims. ... Set the name and role claim; Reset the claims namespaces ...
Read more >
Adding Claims to Trusted Identity Providers - TechDocs
Enter the following command to associate the new claim type with your. SiteMinder. trusted identity provider: $map2 | Add-SPClaimTypeMapping ...
Read more >
How to use InboundClaimTypeMap for claim mapping?
InboundClaimTypeMap is used to transform the incoming claims. It doesn't set the NameClaimType and RoleClaimType properties.
Read more >
Delete Claim Mapping
Go to Main > Identity > Claims and click List. · Click on any available dialect. dialect-links.png · From the Claim Dialect view,...
Read more >
Missing Claims in the ASP.NET Core 2 OpenID Connect ...
Mapping of standard claim types to Microsoft proprietary ones ... you first need to clear the Scope collection and then add openid manually....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found