ClaimsIdentity.FindFirst ClaimsIdentity.FindFirst ClaimsIdentity.FindFirst ClaimsIdentity.FindFirst Method

Definition

Retrieves the first claim that matches a specified condition.

Overloads

FindFirst(Predicate<Claim>) FindFirst(Predicate<Claim>) FindFirst(Predicate<Claim>) FindFirst(Predicate<Claim>)

Retrieves the first claim that is matched by the specified predicate.

FindFirst(String) FindFirst(String) FindFirst(String) FindFirst(String)

Retrieves the first claim with the specified claim type.

FindFirst(Predicate<Claim>) FindFirst(Predicate<Claim>) FindFirst(Predicate<Claim>) FindFirst(Predicate<Claim>)

Retrieves the first claim that is matched by the specified predicate.

public:
 virtual System::Security::Claims::Claim ^ FindFirst(Predicate<System::Security::Claims::Claim ^> ^ match);
public virtual System.Security.Claims.Claim FindFirst (Predicate<System.Security.Claims.Claim> match);
abstract member FindFirst : Predicate<System.Security.Claims.Claim> -> System.Security.Claims.Claim
override this.FindFirst : Predicate<System.Security.Claims.Claim> -> System.Security.Claims.Claim
Public Overridable Function FindFirst (match As Predicate(Of Claim)) As Claim
Parameters
match
Predicate<Claim>

The function that performs the matching logic.

Returns

The first matching claim or null if no match is found.

Exceptions

FindFirst(String) FindFirst(String) FindFirst(String) FindFirst(String)

Retrieves the first claim with the specified claim type.

public:
 virtual System::Security::Claims::Claim ^ FindFirst(System::String ^ type);
public virtual System.Security.Claims.Claim FindFirst (string type);
abstract member FindFirst : string -> System.Security.Claims.Claim
override this.FindFirst : string -> System.Security.Claims.Claim
Public Overridable Function FindFirst (type As String) As Claim
Parameters
type
String String String String

The claim type to match.

Returns

The first matching claim or null if no match is found.

Exceptions

Applies to