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

# OAuthConsentRequiredException

> Thrown when interactive sign-in is required to complete an outbound OAuth grant and [OutboundOAuthOptions.ConsentPresenter](/odata-mcp/api-reference/Microsoft/OData/Mc...

## Definition

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

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

**Inheritance:** System.Exception

## Syntax

```csharp theme={null}
Microsoft.OData.Mcp.Authentication.Outbound.OAuthConsentRequiredException
```

## Summary

Thrown when interactive sign-in is required to complete an outbound OAuth grant and
[OutboundOAuthOptions.ConsentPresenter](https://ai.easyaf.dev/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundOAuthOptions#consentpresenter) is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) — the mid-session path,
where the caller (an MCP tool invocation) must elicit the operator instead of blocking on stderr.

## Remarks

This type lives in `Microsoft.OData.Mcp.Authentication.Outbound`, not Tools, so Authentication never
references Tools. Per `AUTH-12` the wrapped [OAuthConsentRequiredException.Request](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OAuthConsentRequiredException.md#request) never carries an access token, a
refresh token, or a `device_code` — only what is needed to complete sign-in out of band. This type
is not marked `[Serializable]`.

## Examples

```csharp theme={null}
throw new OAuthConsentRequiredException(consentRequest);
```

## Constructors

### &#x20;.ctor

Initializes a new instance of the [OAuthConsentRequiredException](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OAuthConsentRequiredException.md) class.

#### Syntax

```csharp theme={null}
public OAuthConsentRequiredException(Microsoft.OData.Mcp.Authentication.Outbound.OutboundConsentRequest request)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `request` | `Microsoft.OData.Mcp.Authentication.Outbound.OutboundConsentRequest` | The consent request that must be completed before the interrupted call can succeed. |

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *request* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;.ctor

Initializes a new instance of the [OAuthConsentRequiredException](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OAuthConsentRequiredException.md) class with the
exception that caused sign-in to become necessary, such as a failed token refresh.

#### Syntax

```csharp theme={null}
public OAuthConsentRequiredException(Microsoft.OData.Mcp.Authentication.Outbound.OutboundConsentRequest request, System.Exception inner)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `request` | `Microsoft.OData.Mcp.Authentication.Outbound.OutboundConsentRequest` | The consent request that must be completed before the interrupted call can succeed. |
| `inner` | `System.Exception` | The exception that caused sign-in to become necessary. |

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *request* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

## Properties

### &#x20;ElicitationId

Gets [OAuthConsentRequiredException.Request](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OAuthConsentRequiredException.md#request)'s [OutboundConsentRequest.ElicitationId](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundConsentRequest.md#elicitationid).

#### Syntax

```csharp theme={null}
public string ElicitationId { get; }
```

#### Property Value

Type: `string`

### &#x20;Kind

Gets [OAuthConsentRequiredException.Request](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OAuthConsentRequiredException.md#request)'s [OutboundConsentRequest.Kind](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundConsentRequest.md#kind).

#### Syntax

```csharp theme={null}
public Microsoft.OData.Mcp.Authentication.Outbound.OutboundGrantKind Kind { get; }
```

#### Property Value

Type: `Microsoft.OData.Mcp.Authentication.Outbound.OutboundGrantKind`

### &#x20;Request

Gets the consent request that must be completed before the interrupted call can succeed.

#### Syntax

```csharp theme={null}
public Microsoft.OData.Mcp.Authentication.Outbound.OutboundConsentRequest Request { get; }
```

#### Property Value

Type: `Microsoft.OData.Mcp.Authentication.Outbound.OutboundConsentRequest`

### &#x20;Url

Gets [OAuthConsentRequiredException.Request](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OAuthConsentRequiredException.md#request)'s [OutboundConsentRequest.Url](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundConsentRequest.md#url).

#### Syntax

```csharp theme={null}
public System.Uri Url { get; }
```

#### Property Value

Type: `System.Uri`

### &#x20;UserCode

Gets [OAuthConsentRequiredException.Request](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OAuthConsentRequiredException.md#request)'s [OutboundConsentRequest.UserCode](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundConsentRequest.md#usercode).

#### Syntax

```csharp theme={null}
public string UserCode { get; }
```

#### Property Value

Type: `string?`

### &#x20;VerificationUri

Gets [OAuthConsentRequiredException.Request](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OAuthConsentRequiredException.md#request)'s [OutboundConsentRequest.VerificationUri](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundConsentRequest.md#verificationuri).

#### Syntax

```csharp theme={null}
public System.Uri VerificationUri { get; }
```

#### Property Value

Type: `System.Uri?`


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