IdentityExtensions.FindFirstValue Method (ClaimsIdentity, String)

 

Returns the claim value for the first claim with the specified type.

Namespace:   Microsoft.AspNet.Identity
Assembly:  Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)

Syntax

public static string FindFirstValue(
    this ClaimsIdentity identity,
    string claimType
)
public:
[ExtensionAttribute]
static String^ FindFirstValue(
    ClaimsIdentity^ identity,
    String^ claimType
)
static member FindFirstValue : 
        identity:ClaimsIdentity *
        claimType:string -> string
<ExtensionAttribute>
Public Shared Function FindFirstValue (
    identity As ClaimsIdentity,
    claimType As String
) As String

Parameters

Return Value

Type: System.String

The claim value for the first claim with the specified type; otherwise, null if the value doesn’t exist.

See Also

IdentityExtensions Class
Microsoft.AspNet.Identity Namespace
ASP.NET Identity

Return to top