-
Notifications
You must be signed in to change notification settings - Fork 670
Expand file tree
/
Copy pathDynamicClientRegistrationOptions.cs
More file actions
68 lines (62 loc) · 2.65 KB
/
DynamicClientRegistrationOptions.cs
File metadata and controls
68 lines (62 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System.Diagnostics.CodeAnalysis;
namespace ModelContextProtocol.Authentication;
/// <summary>
/// Provides configuration options for the <see cref="ClientOAuthProvider"/> related to dynamic client registration (RFC 7591).
/// </summary>
public sealed class DynamicClientRegistrationOptions
{
/// <summary>
/// Gets or sets the client name to use during dynamic client registration.
/// </summary>
/// <remarks>
/// This value is a human-readable name for the client that can be displayed to users during authorization.
/// </remarks>
public string? ClientName { get; set; }
/// <summary>
/// Gets or sets the client URI to use during dynamic client registration.
/// </summary>
/// <remarks>
/// This value should be a URL pointing to the client's home page or information page.
/// </remarks>
public Uri? ClientUri { get; set; }
/// <summary>
/// Gets or sets the initial access token to use during dynamic client registration.
/// </summary>
/// <remarks>
/// <para>
/// This token is used to authenticate the client during the registration process.
/// </para>
/// <para>
/// This token is required if the authorization server does not allow anonymous client registration.
/// </para>
/// </remarks>
public string? InitialAccessToken { get; set; }
/// <summary>
/// Gets or sets the delegate used for handling the dynamic client registration response.
/// </summary>
/// <remarks>
/// <para>
/// This delegate is responsible for processing the response from the dynamic client registration endpoint.
/// </para>
/// <para>
/// The implementation should save the client credentials securely for future use.
/// </para>
/// </remarks>
public Func<DynamicClientRegistrationResponse, CancellationToken, Task>? ResponseDelegate { get; set; }
/// <summary>
/// Gets or sets the application type to use during dynamic client registration.
/// </summary>
/// <remarks>
/// <para>
/// Valid values are "native" and "web". If not specified, the application type will be
/// automatically determined based on the redirect URI: "native" for localhost/127.0.0.1
/// redirect URIs, "web" for all others.
/// </para>
/// <para>
/// Per the MCP specification, native applications (desktop, mobile, CLI, localhost web apps)
/// should use "native", and web applications (remote browser-based) should use "web".
/// </para>
/// </remarks>
[Experimental(Experimentals.DcrApplicationType_DiagnosticId, UrlFormat = Experimentals.DcrApplicationType_Url)]
public string? ApplicationType { get; set; }
}