> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# McpAuthenticationOptions

> Configuration options for MCP server authentication.

export function DocsBadge({text, variant = 'neutral'}) {
  const variantClasses = {
    success: 'mint-bg-green-500/10 mint-text-green-600 dark:mint-text-green-400 mint-border-green-500/20',
    neutral: 'mint-bg-slate-500/10 mint-text-slate-600 dark:mint-text-slate-400 mint-border-slate-500/20',
    info: 'mint-bg-blue-500/10 mint-text-blue-600 dark:mint-text-blue-400 mint-border-blue-500/20',
    warning: 'mint-bg-amber-500/10 mint-text-amber-600 dark:mint-text-amber-400 mint-border-amber-500/20',
    danger: 'mint-bg-red-500/10 mint-text-red-600 dark:mint-text-red-400 mint-border-red-500/20'
  };
  const classes = variantClasses[variant] || variantClasses.neutral;
  return <span className={`mint-inline-flex mint-items-center mint-px-2 mint-py-0.5 mint-rounded-full mint-text-xs mint-font-medium mint-tracking-wide mint-border mint-ml-1.5 mint-align-middle mint-whitespace-nowrap ${classes}`}>
      {text}
    </span>;
}

## Definition

**Assembly:** Microsoft.OData.Mcp.Authentication.dll

**Namespace:** Microsoft.OData.Mcp.Authentication.Models

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
Microsoft.OData.Mcp.Authentication.Models.McpAuthenticationOptions
```

## Summary

Configuration options for MCP server authentication.

## Remarks

These options control how the MCP server validates and delegates authentication tokens.
The server acts as an OAuth2 resource server, validating tokens issued by external
authorization servers and optionally forwarding them to downstream OData services.

## Constructors

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  .ctor

Initializes a new instance of the [McpAuthenticationOptions](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/McpAuthenticationOptions) class.

#### Syntax

```csharp theme={"dark"}
public McpAuthenticationOptions()
```

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  .ctor <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Enabled

Gets or sets a value indicating whether authentication is enabled.

#### Syntax

```csharp theme={"dark"}
public bool Enabled { get; set; }
```

#### Property Value

Type: `bool`
`true` if authentication is enabled; otherwise, `false`.

#### Remarks

When disabled, the MCP server will allow all requests without authentication.
This is useful for development scenarios or internal deployments where authentication
is handled at a different layer.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  JwtBearer

Gets or sets the JWT bearer token options.

#### Syntax

```csharp theme={"dark"}
public Microsoft.OData.Mcp.Authentication.Models.JwtBearerOptions JwtBearer { get; set; }
```

#### Property Value

Type: `Microsoft.OData.Mcp.Authentication.Models.JwtBearerOptions`
Configuration for JWT token validation.

#### Remarks

These options control how JWT tokens are validated, including issuer validation,
audience validation, and token lifetime checks.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  MetadataCacheDuration

Gets or sets the cache duration for authentication metadata.

#### Syntax

```csharp theme={"dark"}
public System.TimeSpan MetadataCacheDuration { get; set; }
```

#### Property Value

Type: `System.TimeSpan`
The duration to cache authentication metadata like JWKS keys.

#### Remarks

Caching authentication metadata improves performance by avoiding repeated
requests to authorization servers. The cache is automatically refreshed
when metadata expires.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  RequireHttps

Gets or sets a value indicating whether to require HTTPS for authentication.

#### Syntax

```csharp theme={"dark"}
public bool RequireHttps { get; set; }
```

#### Property Value

Type: `bool`
`true` if HTTPS is required for authentication; otherwise, `false`.

#### Remarks

When true, the server will reject authentication attempts over insecure connections.
This should be enabled in production environments to protect authentication tokens.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Scheme

Gets or sets the authentication scheme to use.

#### Syntax

```csharp theme={"dark"}
public string Scheme { get; set; }
```

#### Property Value

Type: `string`
The authentication scheme name (e.g., "Bearer", "JWT").

#### Remarks

This determines which authentication handler will be used to validate incoming requests.
The default is "Bearer" for JWT bearer token authentication.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ScopeAuthorization

Gets or sets the scope-based authorization options.

#### Syntax

```csharp theme={"dark"}
public Microsoft.OData.Mcp.Authentication.Models.ScopeAuthorizationOptions ScopeAuthorization { get; set; }
```

#### Property Value

Type: `Microsoft.OData.Mcp.Authentication.Models.ScopeAuthorizationOptions`
Configuration for OAuth2 scope-based access control.

#### Remarks

These options define which OAuth2 scopes are required for different MCP operations
and how scope-based authorization is enforced.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Timeout

Gets or sets the timeout for authentication operations.

#### Syntax

```csharp theme={"dark"}
public System.TimeSpan Timeout { get; set; }
```

#### Property Value

Type: `System.TimeSpan`
The timeout duration for authentication operations.

#### Remarks

This timeout applies to operations like token validation, metadata discovery,
and communication with authorization servers.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  TokenDelegation

Gets or sets the token delegation options.

#### Syntax

```csharp theme={"dark"}
public Microsoft.OData.Mcp.Authentication.Models.TokenDelegationOptions TokenDelegation { get; set; }
```

#### Property Value

Type: `Microsoft.OData.Mcp.Authentication.Models.TokenDelegationOptions`
Configuration for token delegation to downstream services.

#### Remarks

These options control how tokens are forwarded to OData services and other
downstream dependencies that require authentication.

## Methods

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Equals <DocsBadge text="Inherited" variant="neutral" /> <DocsBadge text="Virtual" variant="warning" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name  | Type      | Description |
| ----- | --------- | ----------- |
| `obj` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Equals <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetHashCode <DocsBadge text="Inherited" variant="neutral" /> <DocsBadge text="Virtual" variant="warning" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetType <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  MemberwiseClone <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ReferenceEquals <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="code-merge" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ToString <DocsBadge text="Override" variant="info" />

Returns a string representation of the authentication options.

#### Syntax

```csharp theme={"dark"}
public override string ToString()
```

#### Returns

Type: `string`
A summary of the authentication configuration.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ToString <DocsBadge text="Inherited" variant="neutral" /> <DocsBadge text="Virtual" variant="warning" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Validate

Validates the authentication options for consistency and completeness.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IEnumerable<string> Validate()
```

#### Returns

Type: `System.Collections.Generic.IEnumerable<string>`
A collection of validation errors, or an empty collection if the options are valid.
