Why does my Authorize Attribute not work-
2017-02-17 17:48
459 查看
the roles of a
When a user is authenticated appropriate claims are added for their roles which can be found later as required.
It's worth bearing this in mind if you have difficult with
in the
working correctly, I strongly recommend you check out his post for all the details.
http://andrewlock.net/introduction-to-authorisation-in-asp-net-core/ https://leastprivilege.com/2016/08/21/why-does-my-authorize-attribute-not-work/
ClaimsPrincipalare actually just claims create with a type of
ClaimsIdentity.RoleClaimType. By default, this is given by
ClaimType.Role, which is the string
http://schemas.microsoft.com/ws/2008/06/identity/claims.
When a user is authenticated appropriate claims are added for their roles which can be found later as required.
It's worth bearing this in mind if you have difficult with
AuthorizeAttributesnot working. Most external identity providers will use a different set of claims representing role, name etc that do not marry up with the values used by Microsoft
in the
ClaimTypeclass. As Dominick Baier discusses on his blog, this can lead to situations where claims are not translated and so users can appear to not be in a given role. If you run into issues where your authorisation does not appear to
working correctly, I strongly recommend you check out his post for all the details.
http://andrewlock.net/introduction-to-authorisation-in-asp-net-core/ https://leastprivilege.com/2016/08/21/why-does-my-authorize-attribute-not-work/
相关文章推荐
- Why does my Authorize Attribute not work-
- Why does my Authorize Attribute not work-
- Why does my Authorize Attribute not work-
- Why does my Authorize Attribute not work?
- Why does my Authorize Attribute not work-
- Why does my shared clipboard not work?
- Why my setting does not work?
- Why does Windows not recognize my USB device as the same device if I plug it into a different port?
- Why my APNs push certificate did not work?
- Why "RefreshRecord" does not work
- [导入]Why does my Windows Form project not use visual styles in XP even when I call Application.EnableVisualStyles?
- Why my update method dose not work?
- FAQ: Why Does The Grader Not Run My Program Correctly? 【USACO】
- IDLE_TIME DOES NOT WORK TO SPECIFY WHEN A SESSION IS AUTOMATICALLY SNIPPED
- According to TLD or attribute directive in tag file, attribute items does not accept any expressions
- 转载/JSTL/attribute value does not accept any express
- The ultimate SO_LINGER page, or: why is my tcp not reliable
- 使用JSTL tag时出现错误:According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute [test] does not accept any expression
- undo backup optimization does not work on 11.2.0.1?