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

# AddCommandAuthSettings

> Everything the `odata-mcp add` wizard collected about how the generated `start` command should authenticate.

## Definition

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

**Namespace:** Microsoft.OData.Mcp.Tools.Commands

**Inheritance:** System.Object

## Syntax

```csharp theme={null}
Microsoft.OData.Mcp.Tools.Commands.AddCommandAuthSettings
```

## Summary

Everything the `odata-mcp add` wizard collected about how the generated `start` command should
authenticate.

## Remarks

Per `AUTH-5` this is a top-level type rather than a tuple or a nested class, because it crosses
three methods — the prompts that fill it, the connection test that turns it into
[OutboundOAuthOptions](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundOAuthOptions.md), and the command builder that turns it into flags.

There is deliberately no client secret property. Per `specs/v3/AUTHENTICATION.md` the wizard never
writes a client secret into MCP configuration at all: it prints an instruction to set
[ODataMcpAuthConstants.ClientSecretEnvironmentVariable](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/ODataMcpAuthConstants.md#clientsecretenvironmentvariable) in the environment that launches the
host, which `start` reads. [AddCommandAuthSettings.ApiKey](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Commands/AddCommandAuthSettings.md#apikey), [AddCommandAuthSettings.BasicPassword](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Commands/AddCommandAuthSettings.md#basicpassword), and
[AddCommandAuthSettings.AuthToken](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Commands/AddCommandAuthSettings.md#authtoken)\<em>are\</em> written, and each is warned about when it is.

## Examples

```csharp theme={null}
var settings = new AddCommandAuthSettings
{
    ClientId = "00000000-0000-0000-0000-000000000000",
    Grant = OutboundGrantKind.DeviceCode,
    Scopes = "https://graph.microsoft.com/.default"
};

var command = wizard.BuildMcpCommand("graph", url, settings, "user", verbose: false);
```

## Constructors

### &#x20;.ctor

#### Syntax

```csharp theme={null}
public AddCommandAuthSettings()
```

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public Object()
```

## Properties

### &#x20;ApiKey

Gets or sets the raw API key, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the operator chose another path.

#### Syntax

```csharp theme={null}
public string ApiKey { get; set; }
```

#### Property Value

Type: `string?`

### &#x20;ApiKeyHeader

Gets or sets the header name [AddCommandAuthSettings.ApiKey](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Tools/Commands/AddCommandAuthSettings.md#apikey) is sent in.

#### Syntax

```csharp theme={null}
public string ApiKeyHeader { get; set; }
```

#### Property Value

Type: `string?`

### &#x20;AuthServer

Gets or sets the authorization server issuer the operator supplied, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when
discovery found one on its own.

#### Syntax

```csharp theme={null}
public string AuthServer { get; set; }
```

#### Property Value

Type: `string?`

### &#x20;AuthToken

Gets or sets the bearer token the operator pasted, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) for every other path.

#### Syntax

```csharp theme={null}
public string AuthToken { get; set; }
```

#### Property Value

Type: `string?`

### &#x20;BasicPassword

Gets or sets the HTTP Basic password.

#### Syntax

```csharp theme={null}
public string BasicPassword { get; set; }
```

#### Property Value

Type: `string?`

### &#x20;BasicUser

Gets or sets the HTTP Basic user name.

#### Syntax

```csharp theme={null}
public string BasicUser { get; set; }
```

#### Property Value

Type: `string?`

### &#x20;ClientId

Gets or sets the OAuth client identifier, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the authorization server
registers one dynamically.

#### Syntax

```csharp theme={null}
public string ClientId { get; set; }
```

#### Property Value

Type: `string?`

### &#x20;Grant

Gets or sets the grant the generated command pins, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) for a non-OAuth path.

#### Syntax

```csharp theme={null}
public System.Nullable<Microsoft.OData.Mcp.Authentication.Outbound.OutboundGrantKind> Grant { get; set; }
```

#### Property Value

Type: `System.Nullable<Microsoft.OData.Mcp.Authentication.Outbound.OutboundGrantKind?>?`

### &#x20;Scopes

Gets or sets the space-delimited scope list, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the challenge or the
protected resource metadata already supplies one.

#### Syntax

```csharp theme={null}
public string Scopes { get; set; }
```

#### Property Value

Type: `string?`

### &#x20;TokenCachePath

Gets or sets the token cache directory the operator chose, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) to leave the
default operating system credential store in place.

#### Syntax

```csharp theme={null}
public string TokenCachePath { get; set; }
```

#### Property Value

Type: `string?`

## Methods

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Returns

Type: `int`

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Returns

Type: `System.Type`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Returns

Type: `object`

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### &#x20;ToOutboundOptions

Turns these settings into the outbound options the `start` command would build from the same
flags, so a connection test exercises the real authentication path rather than a simplified one.

#### Syntax

```csharp theme={null}
public Microsoft.OData.Mcp.Authentication.Outbound.OutboundOAuthOptions ToOutboundOptions()
```

#### Returns

Type: `Microsoft.OData.Mcp.Authentication.Outbound.OutboundOAuthOptions`
The options, with [ODataMcpAuthConstants.ClientSecretEnvironmentVariable](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/ODataMcpAuthConstants.md#clientsecretenvironmentvariable) and
[ODataMcpAuthConstants.IdTokenEnvironmentVariable](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/ODataMcpAuthConstants.md#idtokenenvironmentvariable) already folded in.

#### Examples

```csharp theme={null}
using var host = await ToolsMcpHost.CreateAsync(url, settings.ToOutboundOptions(), false, false, null, ct);
```

#### Remarks

The environment is read here for the same reason `start` reads it: a client credentials test
that ignored `ODATA_MCP_CLIENT_SECRET` would fail for a reason the operator has already been
told how to fix.

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Returns

Type: `string?`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.