Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

How to decode Microsoft Local token in service

// Getting Decoded Token from the HTTP context
// May very according to place where you are using it.
// You can use it in Controller/AttributeFilter/Middlerware.

var identity = HttpContext.User.Identity as ClaimsIdentity;

// Gets list of claims.
IEnumerable<Claim> claims = identity.Claims;

// Can find any value from claim by changing below code
var Name = claims.Where(x => x.Type == ClaimTypes.Name).ToArray();

// Do the next opertaion
Comment

PREVIOUS NEXT
Code Example
Csharp :: Show empty message in data table angular material, If no data found 
Csharp :: how to fill model enum with bradio button asp razor 
Csharp :: demand a Security action c# 
Csharp :: Convert integers to written numbers C# 
Csharp :: c# query string builder 
Csharp :: c# try parse date yyyymmdd 
Csharp :: disable alt + f4 in c# forms 
Csharp :: Ignore case string linq c# 
Csharp :: button event trigger wpf 
Csharp :: c# double without exponential notation 
Csharp :: KeyValuePair is default 
Csharp :: c# networkstream read all bytes 
Csharp :: how to iterate a generic list in c# 
Csharp :: array in c# 
Csharp :: disable version header c# 
Csharp :: android jaca how to pass a imageurl in a recyclerview adapter 
Csharp :: create list of strings from field of list of object c# 
Csharp :: how to insert data into multiple tables using asp.net c# 
Csharp :: instantiate date time variable C# 
Csharp :: c# convert bool to string 
Csharp :: c# method declaration 
Csharp :: by value by reference c# 
Csharp :: c# exception middleware 
Csharp :: camelCase and snakeCase 
Csharp :: combined 2 arrays 
Csharp :: send email every 5 minutes c# 
Csharp :: How to remove an element from Array List in C#? 
Csharp :: c# core linq savechanges invalid column name error while adding but not while updating 
Csharp :: <link rel="stylesheet" href="styles/kendo.common.min.css" / 
Csharp :: get one parameter from list in an new list c# 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =