Getting custom claim value from bearer token (Web API) Getting custom claim value from bearer token (Web API) asp.net asp.net

Getting custom claim value from bearer token (Web API)


Sure, inside your protected controller you do the following:

 ClaimsPrincipal principal = Request.GetRequestContext().Principal as ClaimsPrincipal; var customClaimValue = principal.Claims.Where(c => c.Type == "CompanyID").Single().Value;