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.

Should RoleClaimType be mapped to roles by default?

See original GitHub issue

I noticed that in the latest version I cannot add validation for a role as a C# attribute to an MVC controller anymore. Instead I have to add a line in the controller action.

I would still like to be able to use this syntax

[Authorize("role")]
MyController
{
...

instead of

HttpContext.ValidateAppRole("role")

Would this be possible in the future? Or do I have to implement an attribute myself?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
jennyf19commented, Oct 28, 2020

@molntamas yes, please specify the roles explicitly.

Closing, but please reopen if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mapping, customizing, and transforming claims in ASP. ...
The claims can be mapped using the TokenValidationParameters property and set to any claim as required.
Read more >
Implement app roles authorization with Azure AD and ASP ...
This post shows how to implement Azure AD App roles and applied to ... The roles and the name can should also be...
Read more >
User Roles - Microsoft Q&A
By default, the claims mapping will map claim names in the old format to accommodate older SAML applications.
Read more >
Why does the role claim have incorrect type?
RoleClaimType) returns an empty list, even though I have proper roles assigned. This is I guess, because -- according to the debugger --...
Read more >
Dealing with claim types map — Balea 1.0.0 documentation
Configure the claim types map¶. By default, Balea asummes you are within Microsoft roles world. So, Balea will map roles from the authentication...
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