Skip to content
IOF edited this page Nov 28, 2025 · 1 revision
public static class GetOwnerId
{
    public static Guid GetOwnerIdFromClaims(this ClaimsPrincipal user)
    {
        var ownerIdClaim = user.FindFirstValue(ClaimTypes.NameIdentifier);
        return Guid.TryParse(ownerIdClaim, out var ownerId) ? ownerId : Guid.Empty;
    }
}

Clone this wiki locally