ClaimsPrincipalExtensions.GetDisplayName(ClaimsPrincipal) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Get the display name for the signed-in user, from the ClaimsPrincipal.
public static string? GetDisplayName (this System.Security.Claims.ClaimsPrincipal claimsPrincipal);
static member GetDisplayName : System.Security.Claims.ClaimsPrincipal -> string
<Extension()>
Public Function GetDisplayName (claimsPrincipal As ClaimsPrincipal) As String
Parameters
- claimsPrincipal
- ClaimsPrincipal
Claims about the user/account.
Returns
A string containing the display name for the user, as determined by Azure AD (v1.0) and Microsoft identity platform (v2.0) tokens,
or null
if the claims cannot be found.
Remarks
See https://video2.skills-academy.com/azure/active-directory/develop/id-tokens#payload-claims.