Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.AspNetCore.dll Namespace: Microsoft.OData.Mcp.AspNetCore.HealthChecks Inheritance: System.Object

Syntax

Microsoft.OData.Mcp.AspNetCore.HealthChecks.AuthenticationHealthCheck

Summary

Health check for the authentication system.

Remarks

This health check verifies that the authentication components are functioning correctly, including token validation services, authority connectivity, and configuration validity.

Constructors

.ctor

Initializes a new instance of the AuthenticationHealthCheck class.

Syntax

public AuthenticationHealthCheck(Microsoft.Extensions.Options.IOptions<Microsoft.OData.Mcp.Authentication.Models.McpAuthenticationOptions> authOptions, Microsoft.Extensions.Logging.ILogger<Microsoft.OData.Mcp.AspNetCore.HealthChecks.AuthenticationHealthCheck> logger, Microsoft.OData.Mcp.Authentication.Services.ITokenValidationService tokenValidationService = null, System.Net.Http.IHttpClientFactory httpClientFactory = null)

Parameters

NameTypeDescription
authOptionsMicrosoft.Extensions.Options.IOptions<Microsoft.OData.Mcp.Authentication.Models.McpAuthenticationOptions>The authentication options.
loggerMicrosoft.Extensions.Logging.ILogger<Microsoft.OData.Mcp.AspNetCore.HealthChecks.AuthenticationHealthCheck>The logger instance.
tokenValidationServiceMicrosoft.OData.Mcp.Authentication.Services.ITokenValidationService?The token validation service (optional).
httpClientFactorySystem.Net.Http.IHttpClientFactory?The HTTP client factory (optional).

Exceptions

ExceptionDescription
ArgumentNullExceptionThrown when authOptions or logger is null.

.ctor Inherited

Inherited from object

Syntax

public Object()

Methods

CheckHealthAsync

Checks the health of the authentication system.

Syntax

public System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult> CheckHealthAsync(Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext context, System.Threading.CancellationToken cancellationToken = null)

Parameters

NameTypeDescription
contextMicrosoft.Extensions.Diagnostics.HealthChecks.HealthCheckContextThe health check context.
cancellationTokenSystem.Threading.CancellationTokenA cancellation token to cancel the operation.

Returns

Type: System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult> A task that represents the asynchronous health check operation.

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?
  • Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck