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

# AuthorizationServerMetadata

> The RFC 8414 authorization server metadata document, or its OpenID Connect discovery document counterpart, restricted to the endpoints, advertised grants and...

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

## Summary

The RFC 8414 authorization server metadata document, or its OpenID Connect discovery document
counterpart, restricted to the endpoints, advertised grants and scopes, and PKCE / dynamic client
registration capability flags outbound OAuth discovery actually reads.

## Remarks

Deserialized exclusively through [OutboundOAuthJsonContext](https://learn.microsoft.com/dotnet/api/microsoft.odata.mcp.authentication.outbound.outboundoauthjsoncontext); this type is never read with
reflection-based `System.Text.Json` serialization (AOT: JSON source-gen; no reflection). Unknown
fields the discovery document may carry (signing algorithms, UI locales, and similar) are intentionally
not modeled here per `specs/v3/AUTHENTICATION.md` "Authentication outbound" type map.

## Examples

```csharp theme={null}
var json = await client.GetStringAsync(wellKnownUri);
var metadata = JsonSerializer.Deserialize(json, OutboundOAuthJsonContext.Default.AuthorizationServerMetadata);
if (metadata is not null &amp;&amp; metadata.AdvertisesGrant(ODataMcpAuthConstants.DeviceCodeGrantType))
{
    // Start a device code grant.
}
```

## Constructors

### &#x20;.ctor

#### Syntax

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

### &#x20;.ctor Inherited

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

#### Syntax

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

## Properties

### &#x20;AuthorizationEndpoint

Gets or sets the RFC 6749 authorization endpoint.

#### Syntax

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

#### Property Value

Type: `System.Uri?`

### &#x20;AuthorizationResponseIssParameterSupported

Gets or sets whether the authorization response carries the RFC 9207 `iss` parameter.

#### Syntax

```csharp theme={null}
public System.Nullable<bool> AuthorizationResponseIssParameterSupported { get; set; }
```

#### Property Value

Type: `System.Nullable<bool>?`

### &#x20;ClientIdMetadataDocumentSupported

Gets or sets whether this server accepts a client id metadata document (CIMD) in place of a
pre-registered client id.

#### Syntax

```csharp theme={null}
public System.Nullable<bool> ClientIdMetadataDocumentSupported { get; set; }
```

#### Property Value

Type: `System.Nullable<bool>?`

### &#x20;CodeChallengeMethodsSupported

Gets or sets the RFC 7636 PKCE code challenge methods this server accepts, such as `S256`.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.IList<string> CodeChallengeMethodsSupported { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.IList<string>?`

### &#x20;DeviceAuthorizationEndpoint

Gets or sets the RFC 8628 device authorization endpoint.

#### Syntax

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

#### Property Value

Type: `System.Uri?`

### &#x20;GrantTypesSupported

Gets or sets the OAuth 2.0 / OpenID Connect grant types this server advertises.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.IList<string> GrantTypesSupported { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.IList<string>?`

### &#x20;Issuer

Gets or sets the issuer identifier, exactly as the document spells it.

#### Syntax

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

#### Property Value

Type: `string?`

#### Remarks

Deliberately a [String](https://learn.microsoft.com/dotnet/api/system.string) rather than a [Uri](https://learn.microsoft.com/dotnet/api/system.uri). RFC 8414 section 2 and RFC 9207
both compare issuer identifiers by simple string comparison, and [Uri](https://learn.microsoft.com/dotnet/api/system.uri) normalizes: it
turns the authority-only issuer `https://accounts.google.com` into
`https://accounts.google.com/`, which would make a conforming authorization server's
`iss` look like a mix-up attack. Use [AuthorizationServerMetadata.IssuerUri](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/AuthorizationServerMetadata.md#issueruri) where a URI is genuinely needed.

### &#x20;IssuerUri

Gets [AuthorizationServerMetadata.Issuer](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/AuthorizationServerMetadata.md#issuer) as an absolute URI, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when it is absent or is not
an absolute URI.

#### Syntax

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

#### Property Value

Type: `System.Uri?`

#### Remarks

Never used for an issuer comparison — that is [AuthorizationServerMetadata.Issuer](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/AuthorizationServerMetadata.md#issuer)'s job — only where a collaborator
requires a [Uri](https://learn.microsoft.com/dotnet/api/system.uri), such as the SDK identity assertion provider.

### &#x20;RegistrationEndpoint

Gets or sets the RFC 7591 dynamic client registration endpoint, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when this
server requires a pre-registered client id.

#### Syntax

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

#### Property Value

Type: `System.Uri?`

### &#x20;ResponseTypesSupported

Gets or sets the response types this server's authorization endpoint accepts.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.IList<string> ResponseTypesSupported { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.IList<string>?`

### &#x20;RevocationEndpoint

Gets or sets the RFC 7009 token revocation endpoint.

#### Syntax

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

#### Property Value

Type: `System.Uri?`

### &#x20;ScopesSupported

Gets or sets the scopes this server advertises.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.IList<string> ScopesSupported { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.IList<string>?`

### &#x20;TokenEndpoint

Gets or sets the RFC 6749 token endpoint.

#### Syntax

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

#### Property Value

Type: `System.Uri?`

### &#x20;TokenEndpointAuthMethodsSupported

Gets or sets the client authentication methods the token endpoint accepts.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.IList<string> TokenEndpointAuthMethodsSupported { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.IList<string>?`

## Methods

### &#x20;AdvertisesGrant

Determines whether this server advertises a grant type, treating the RFC 8628 short form
`device_code` and the [ODataMcpAuthConstants.DeviceCodeGrantType](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/ODataMcpAuthConstants.md#devicecodegranttype) URN as
equivalent in either direction.

#### Syntax

```csharp theme={null}
public bool AdvertisesGrant(string grantType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `grantType` | `string` | The grant type to look for, such as `authorization_code` or `device_code`. |

#### Returns

Type: `bool`
[`true`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) when [AuthorizationServerMetadata.GrantTypesSupported](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/AuthorizationServerMetadata.md#granttypessupported) contains an ordinal match for
*grantType*, or its device-code counterpart; otherwise [`false`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool).

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentException` | Thrown when *grantType* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), empty, or whitespace. |

#### Remarks

Advertised grant lists use either spelling depending on the authorization server, so a caller that
asks for either one gets the same answer regardless of which spelling was actually published.

### &#x20;AdvertisesScope

Determines whether this server advertises a scope.

#### Syntax

```csharp theme={null}
public bool AdvertisesScope(string scope)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `scope` | `string` | The scope to look for. |

#### Returns

Type: `bool`
[`true`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) when [AuthorizationServerMetadata.ScopesSupported](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/AuthorizationServerMetadata.md#scopessupported) contains an ordinal match for
*scope*; otherwise [`false`](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool).

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentException` | Thrown when *scope* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), empty, or whitespace. |

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