UserManager<TUser>.GetUserId(ClaimsPrincipal) UserManager<TUser>.GetUserId(ClaimsPrincipal) UserManager<TUser>.GetUserId(ClaimsPrincipal) Method

Definition

Returns the User ID claim value if present otherwise returns null.

public virtual string GetUserId (System.Security.Claims.ClaimsPrincipal principal);
abstract member GetUserId : System.Security.Claims.ClaimsPrincipal -> string
override this.GetUserId : System.Security.Claims.ClaimsPrincipal -> string
Public Overridable Function GetUserId (principal As ClaimsPrincipal) As String

Parameters

Returns

The User ID claim value, or null if the claim is not present.

Remarks

The User ID claim is identified by NameIdentifier.

Applies to