<PackageReference Include="Grpc.Core.Api" Version="2.76.0" />

Grpc.Core.AuthContext

public class AuthContext
Authentication context for a call. AuthContext is the only reliable source of truth when it comes to authenticating calls. Using any other call/context properties for authentication purposes is wrong and inherently unsafe. Note: experimental API that can change or be removed without any prior notice.
public bool IsPeerAuthenticated { get; }

Returns true if the peer is authenticated.

Gets properties that represent the peer identity (there can be more than one). Returns an empty collection if the peer is not authenticated.

public string PeerIdentityPropertyName { get; }

Gets the name of the property that indicates the peer identity. Returns null if the peer is not authenticated.

Gets the auth properties of this context.

public AuthContext(string peerIdentityPropertyName, Dictionary<string, List<AuthProperty>> properties)

Initializes a new instance of the AuthContext class.

public IEnumerable<AuthProperty> FindPropertiesByName(string propertyName)

Returns the auth properties with given name (there can be more than one). If no properties of given name exist, an empty collection will be returned.