Angular SPA with ASP.NET API and SSO

The user’s identity will be in the sub claim in the JWT. Inside ASP.NET this will be available in the NameIdentifier claim.

You were not clear on whether you are using ASP.NET Core, or OWIN. So this is how you would do it for both:

For ASP.NET Core

// Inside your controller action, access the user id as follows:
var userId = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier).Value;

For ASP.NET (OWIN)

// Inside your controller action, access the user id as follows:
var claimsPrincipal = User as ClaimsPrincipal;
var userId = claimsPrincipal.Claims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier).Value;