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

# ClientCredentials

> Represents client credentials for OAuth2 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.ClientCredentials
```

## Summary

Represents client credentials for OAuth2 authentication.

## Remarks

These credentials identify the MCP server to authorization servers when performing
OAuth2 flows that require client authentication, such as token exchange or
on-behalf-of flows.

## Constructors

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

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

#### Syntax

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

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

Initializes a new instance of the [ClientCredentials](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/ClientCredentials) class with client secret authentication.

#### Syntax

```csharp theme={"dark"}
public ClientCredentials(string clientId, string clientSecret)
```

#### Parameters

| Name           | Type     | Description            |
| -------------- | -------- | ---------------------- |
| `clientId`     | `string` | The client identifier. |
| `clientSecret` | `string` | The client secret.     |

#### Exceptions

| Exception           | Description                                                     |
| ------------------- | --------------------------------------------------------------- |
| `ArgumentException` | Thrown when *clientId* or *clientSecret* is null or whitespace. |

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

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

#### Syntax

```csharp theme={"dark"}
public ClientCredentials(string clientId, Microsoft.OData.Mcp.Authentication.Models.ClientCertificate certificate)
```

#### Parameters

| Name          | Type                                                          | Description                           |
| ------------- | ------------------------------------------------------------- | ------------------------------------- |
| `clientId`    | `string`                                                      | The client identifier.                |
| `certificate` | `Microsoft.OData.Mcp.Authentication.Models.ClientCertificate` | The client certificate configuration. |

#### Exceptions

| Exception               | Description                                   |
| ----------------------- | --------------------------------------------- |
| `ArgumentException`     | Thrown when *clientId* is null or whitespace. |
| `ArgumentNullException` | Thrown when *certificate* is null.            |

### <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' }} />  AuthenticationMethod

Gets or sets the client authentication method.

#### Syntax

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

#### Property Value

Type: `Microsoft.OData.Mcp.Authentication.Models.ClientAuthenticationMethod?`
The method used to authenticate the client to the authorization server.

#### Remarks

Different authorization servers support different client authentication methods.
The most common are client secrets and certificate-based authentication.

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

Gets or sets the certificate for certificate-based authentication.

#### Syntax

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

#### Property Value

Type: `Microsoft.OData.Mcp.Authentication.Models.ClientCertificate?`
Configuration for client certificate authentication.

#### Remarks

This certificate is used when the authentication method requires certificate-based
authentication. It provides a more secure alternative to client secrets.

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

Gets or sets the assertion for JWT-based client authentication.

#### Syntax

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

#### Property Value

Type: `string?`
The JWT assertion used for client authentication.

#### Remarks

This is used when the authentication method is PrivateKeyJwt or ClientSecretJwt.
The assertion must be properly signed and contain the required claims.

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

Gets or sets the assertion type for JWT-based client authentication.

#### Syntax

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

#### Property Value

Type: `string?`
The type of the client assertion.

#### Remarks

This is typically "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
for JWT-based client authentication methods.

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

Gets or sets the client identifier.

#### Syntax

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

#### Property Value

Type: `string`
The client ID registered with the authorization server.

#### Remarks

The client ID uniquely identifies the MCP server application to the
authorization server. It is typically a GUID or other unique string
assigned during application registration.

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

Gets or sets the client secret for secret-based authentication.

#### Syntax

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

#### Property Value

Type: `string?`
The client secret registered with the authorization server.

#### Remarks

This secret is used when the authentication method is ClientSecret or ClientSecretPost.
It should be kept secure and rotated regularly for security best practices.

## 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 client credentials.

#### Syntax

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

#### Returns

Type: `string`
A summary of the client credentials 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 client credentials 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 credentials are valid.
