File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/CodeOfChaos.Extensions Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1+ // ---------------------------------------------------------------------------------------------------------------------
2+ // Imports
3+ // ---------------------------------------------------------------------------------------------------------------------
4+ using System . Security . Claims ;
5+
6+ namespace CodeOfChaos . Extensions ;
7+
8+ // ---------------------------------------------------------------------------------------------------------------------
9+ // Code
10+ // ---------------------------------------------------------------------------------------------------------------------
11+ public static class ClaimsPrincipalExtensions {
12+ public static IEnumerable < string > FindAllValues ( this ClaimsPrincipal principal , string type ) {
13+ IEnumerable < Claim > claims = principal . FindAll ( type ) ;
14+ return claims . Select ( c => c . Value ) ;
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments