#### [Abblix\.Oidc\.Server](https://www.abblix.com/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Common\.Configuration](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration 'Abblix\.Oidc\.Server\.Common\.Configuration')

## ClientIdMetadataDocumentOptions Class

How the server treats a client that identifies itself by the URL of its own metadata document instead of a
registration \(draft\-ietf\-oauth\-client\-id\-metadata\-document\): which such URLs it accepts, how much of a document it
reads and how long it holds one\.

```csharp
public record ClientIdMetadataDocumentOptions : System.IEquatable<Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions>
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → ClientIdMetadataDocumentOptions

Implements [System\.IEquatable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.iequatable-1 'System\.IEquatable\`1')[ClientIdMetadataDocumentOptions](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions 'Abblix\.Oidc\.Server\.Common\.Configuration\.ClientIdMetadataDocumentOptions')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.iequatable-1 'System\.IEquatable\`1')

### Remarks
None of this applies until the host calls `AddClientIdMetadataDocuments()`\. A client resolved from its
document is held to [NewClientOptions](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.OidcOptions#Abblix.Oidc.Server.Common.Configuration.OidcOptions.NewClientOptions 'Abblix\.Oidc\.Server\.Common\.Configuration\.OidcOptions\.NewClientOptions') as a dynamically registered one is, its default
scope, the resources and token exchange audiences it may name and the audiences of its assertions among them,
because its metadata is as much the client's own word as a registration request is\.
### Properties

## ClientIdMetadataDocumentOptions\.AllowedClientIdPrefixes Property {#Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions.AllowedClientIdPrefixes}

The prefixes a client identifier URL must start with to be fetched, or null \(the default\) to fetch any URL the
draft's rules allow\.

```csharp
public string[]? AllowedClientIdPrefixes { get; init; }
```

#### Property Value
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array')

### Remarks
Section 10\.8 of the draft lets an authorization server "maintain allowlists of trusted domain patterns"\. Each
entry is an absolute `https` URL whose path ends with a slash, such as `https://apps.example.com/`
or `https://example.com/clients/`, and a client identifier is compared with it character for character:
section 3 has the server compare these URLs "using simple string comparison" and never normalize them, so
`https://example.com:443/` and `https://Example.com/` admit nothing that `https://example.com/`
would\. The closing slash is what keeps `https://example.com/` from admitting
`https://example.com.attacker.test/`; an entry without one, an empty list, an entry with a query, a
fragment or user information, and one of any other scheme are refused at startup\.

## ClientIdMetadataDocumentOptions\.AllowedGrantTypes Property {#Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions.AllowedGrantTypes}

The grant types a client resolved from its document may use\. Unset, those an end user takes part in,
[Abblix\.Oidc\.Server\.Common\.Configuration\.NewClientOptions\.SignInGrantTypes](https://learn.microsoft.com/en-us/dotnet/api/abblix.oidc.server.common.configuration.newclientoptions.signingranttypes 'Abblix\.Oidc\.Server\.Common\.Configuration\.NewClientOptions\.SignInGrantTypes')\.

```csharp
public string[]? AllowedGrantTypes { get; init; }
```

#### Property Value
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array')

### Remarks
A document is anybody's, so a grant no end user approves, such as client credentials, would give whoever wrote
it tokens of its own\. A document's grant types are narrowed to these, to those the server supports and to
[AllowedGrantTypes](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.NewClientOptions#Abblix.Oidc.Server.Common.Configuration.NewClientOptions.AllowedGrantTypes 'Abblix\.Oidc\.Server\.Common\.Configuration\.NewClientOptions\.AllowedGrantTypes')\. Whatever this allows, a client authenticating with
`none` is never given the client credentials, password or JWT bearer grant: RFC 6749 section 4\.4 says
"The client credentials grant type MUST only be used by confidential clients"\. A document's client given that
grant gets tokens whose `idp` is `client_credentials`, which marks them as the client's own \(RFC 9700
section 4\.15\.1\)\. An empty list and a blank entry are refused at startup\. Unset rather than holding the default,
so a list bound from configuration is taken as written: the configuration binder adds to a list already there\.

## ClientIdMetadataDocumentOptions\.DocumentAddresses Property {#Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions.DocumentAddresses}

Which addresses a document may be fetched from\. Default: [PublicOnly](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentAddresses#Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentAddresses.PublicOnly 'Abblix\.Oidc\.Server\.Common\.Configuration\.ClientIdMetadataDocumentAddresses\.PublicOnly')\.

```csharp
public Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentAddresses DocumentAddresses { get; init; }
```

#### Property Value
[ClientIdMetadataDocumentAddresses](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentAddresses 'Abblix\.Oidc\.Server\.Common\.Configuration\.ClientIdMetadataDocumentAddresses')

### Remarks
[AllowLoopback](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentAddresses#Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentAddresses.AllowLoopback 'Abblix\.Oidc\.Server\.Common\.Configuration\.ClientIdMetadataDocumentAddresses\.AllowLoopback') lets a provider and a client running
            on one development machine try the feature, by the exception section 10\.7 of the draft makes\. A value naming no
            member is refused at startup\.

## ClientIdMetadataDocumentOptions\.Enabled Property {#Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions.Enabled}

Whether the server resolves clients from their metadata documents and advertises
`client_id_metadata_document_supported` in its discovery document\.

```csharp
public bool Enabled { get; }
```

#### Property Value
[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')

### Remarks
Set by `AddClientIdMetadataDocuments()` alone, never from configuration: the setter is not public, so a
configuration file cannot advertise the feature in discovery while nothing resolves such a client\.

## ClientIdMetadataDocumentOptions\.FetchTimeout Property {#Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions.FetchTimeout}

The longest a fetch of a document may take, its body included\. Default: 5 seconds\.

```csharp
public System.TimeSpan FetchTimeout { get; init; }
```

#### Property Value
[System\.TimeSpan](https://learn.microsoft.com/en-us/dotnet/api/system.timespan 'System\.TimeSpan')

### Remarks
The fetch runs while the authorization or token request naming the client waits, and anybody can name a URL
whose server answers slowly, so this is shorter than the server's other outbound fetches take\.

## ClientIdMetadataDocumentOptions\.MaxDocumentSize Property {#Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions.MaxDocumentSize}

The most of a metadata document the server reads, in bytes; a longer one is refused\. Default: 5 KB\.

```csharp
public int MaxDocumentSize { get; init; }
```

#### Property Value
[System\.Int32](https://learn.microsoft.com/en-us/dotnet/api/system.int32 'System\.Int32')

### Remarks
Section 10\.11 of the draft: authorization servers "SHOULD limit the amount of data they read and process when
fetching a Client ID Metadata Document", and "the recommended maximum size to read is 5 kilobytes"\.

## ClientIdMetadataDocumentOptions\.MaxHeldDocuments Property {#Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions.MaxHeldDocuments}

The most documents held at once\. Default: 10000\. Read once, when the server starts\.

```csharp
public int MaxHeldDocuments { get; init; }
```

#### Property Value
[System\.Int32](https://learn.microsoft.com/en-us/dotnet/api/system.int32 'System\.Int32')

### Remarks
Whoever sends an authorization request names the URL, so without a bound a host answering every path with a
document naming that path would fill the server's memory for [MaximumCacheDuration](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions#Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions.MaximumCacheDuration 'Abblix\.Oidc\.Server\.Common\.Configuration\.ClientIdMetadataDocumentOptions\.MaximumCacheDuration')\. A document
arriving while the server holds this many is served to the request that fetched it and not held, so it is fetched
again on its next use, which section 6\.2 of the draft allows a server doing "to avoid repeatedly fetching" no
less than it allows holding\.

## ClientIdMetadataDocumentOptions\.MaximumCacheDuration Property {#Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions.MaximumCacheDuration}

The longest a document is held, whatever its response asks for\. Default: 1 hour\.

```csharp
public System.TimeSpan MaximumCacheDuration { get; init; }
```

#### Property Value
[System\.TimeSpan](https://learn.microsoft.com/en-us/dotnet/api/system.timespan 'System\.TimeSpan')

### Remarks
Section 6\.2 of the draft: the server "SHOULD enforce a maximum effective cache duration regardless of the cache
directives in the response"\. This bounds how long a redirect URI or a key a client has removed from its
document is still honored here\. A document whose lifetime has passed is fetched again on the next request, and
when that fetch fails for a reason that may pass, a network error, a timeout or a 5xx answer, the copy held is
served until this much time has passed since it was fetched: section 6\.1 has the server not "discard previously
cached valid client metadata on transient failures"\.

## ClientIdMetadataDocumentOptions\.MinimumCacheDuration Property {#Abblix.Oidc.Server.Common.Configuration.ClientIdMetadataDocumentOptions.MinimumCacheDuration}

How long a document is held when its response states no lifetime of its own\. Default: 5 minutes\.

```csharp
public System.TimeSpan MinimumCacheDuration { get; init; }
```

#### Property Value
[System\.TimeSpan](https://learn.microsoft.com/en-us/dotnet/api/system.timespan 'System\.TimeSpan')

### Remarks
Section 6\.2 of the draft: the server "SHOULD respect HTTP cache headers \[RFC9111\]" and "SHOULD also enforce a
minimum effective cache duration when none is otherwise indicated"\. So a response carrying `max-age` is
held for that long, one carrying `no-store` or `no-cache` is not held at all, and this applies only
to a response saying nothing about it\.
