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

# OutboundConsentRequest

> The consent-request payload passed to [OutboundOAuthOptions.ConsentPresenter](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundOAuthOptions...

## Definition

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

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

**Inheritance:** System.Object

## Syntax

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

## Summary

The consent-request payload passed to [OutboundOAuthOptions.ConsentPresenter](https://ai.easyaf.dev/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundOAuthOptions#consentpresenter), and carried by
[OAuthConsentRequiredException](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OAuthConsentRequiredException.md), when interactive sign-in is required to complete an outbound
OAuth grant.

## Remarks

Per `AUTH-12` this type never carries a `device_code`, an access token, a refresh token, or a
PKCE `code_verifier` — only what a human or an MCP client needs to complete sign-in out of band.
Fields that must stay off this type (the pending grant's `device_code`, `interval`,
`code_verifier`, expected `state`, and live `HttpListener`) live instead on
`OutboundOAuthClient`'s internal pending-grant state.

Every URL on this type is server-controlled: it comes from an authorization server that a malicious
protected resource could have named. Because a consent URL is handed to `ShellExecute` by the stdio
presenter and to an MCP client as an elicitation URL, the constructor is the chokepoint that refuses any
scheme other than `https`, or `http` on a loopback host, before either can happen.

## Examples

```csharp theme={null}
var request = new OutboundConsentRequest(
    OutboundGrantKind.DeviceCode,
    new Uri("https://login.microsoftonline.com/common/oauth2/v2.0/devicecode"),
    "Sign in to continue.",
    userCode: "ABCD-EFGH",
    verificationUri: new Uri("https://microsoft.com/devicelogin"));
```

## Constructors

### &#x20;.ctor

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

#### Syntax

```csharp theme={null}
public OutboundConsentRequest(Microsoft.OData.Mcp.Authentication.Outbound.OutboundGrantKind kind, System.Uri url, string message, string userCode, System.Uri verificationUri, string elicitationId = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `kind` | `Microsoft.OData.Mcp.Authentication.Outbound.OutboundGrantKind?` | The grant kind this consent request is completing. |
| `url` | `System.Uri` | The absolute URL to open to complete sign-in. |
| `message` | `string` | The human-readable message describing what to do. |
| `userCode` | `string?` | The short code a human types at *verificationUri*, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |
| `verificationUri` | `System.Uri?` | The verification URI a human is directed to, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |
| `elicitationId` | `string?` | The correlation identifier, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) to generate a new `D`-format GUID. |

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *url* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |
| `ArgumentException` | Thrown when *url* is not an absolute URI, when *message* is empty or |
| white space, or when *elicitationId* is non-[`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) and empty or white space. | |
| `OutboundDiscoveryException` | Thrown when *url* or *verificationUri* is neither an `https` |
| URI nor an `http` URI on a loopback host. | |

#### Remarks

The scheme check runs on both URLs and it runs here rather than at each presenter, because there is
no presenter this instance is guaranteed to reach: it is also carried by
[OAuthConsentRequiredException](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OAuthConsentRequiredException.md) to whatever host catches it.

### &#x20;.ctor Inherited

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

#### Syntax

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

## Properties

### &#x20;ElicitationId

Gets the identifier this consent request correlates an MCP elicitation to.

#### Syntax

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

#### Property Value

Type: `string`

### &#x20;Kind

Gets the grant kind this consent request is completing.

#### Syntax

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

#### Property Value

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

### &#x20;Message

Gets the human-readable message describing what the operator or the LLM should do.

#### Syntax

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

#### Property Value

Type: `string`

### &#x20;Url

Gets the absolute URL to open to complete sign-in: an authorization URI for interactive grants, or a
device verification URI for the device code grant.

#### Syntax

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

#### Property Value

Type: `System.Uri`

### &#x20;UserCode

Gets the short code a human types at [OutboundConsentRequest.VerificationUri](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundConsentRequest.md#verificationuri), or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when
the grant kind does not use one.

#### Syntax

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

#### Property Value

Type: `string?`

### &#x20;VerificationUri

Gets the verification URI a human is directed to enter [OutboundConsentRequest.UserCode](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundConsentRequest.md#usercode) at, or
[`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the grant kind does not use one.

#### Syntax

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

#### Property Value

Type: `System.Uri?`

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