Compartir a través de


ClaimsPrincipalExtensions.GetDisplayName(ClaimsPrincipal) Method

Definition

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://learn.microsoft.com/azure/active-directory/develop/id-tokens#payload-claims.

Applies to