How do I get the User Name / Log In Id / Unique Identifier of the current user signed in?

Using okta, how do I get the User Name / Log In Id / Unique Identifier of the current user signed in?

I am currently working on an ASP.Net Web Forms App. After the user successfully signs in, I can get the name of the user with the code below.

var name = User.Identity.Name;

However, I want the Log In Id / Unique Identifier of the User. Looking at the Profile form on the okta web site, it looks like okta calls that file User Name.

After doing some research, I did write up some code that gets what I want using the ClaimsPrincipal class and claimType == “preferred_username” (Not sure what claim type to use. Is there a better option?). But the code seems like a hack to me. Looking for the Standard Way to get this value.