Append offline_access to authorization scope when AS advertises it (SEP-2207) (#1479)
This commit is contained in:
parent
b8c4d951ec
commit
74788af04d
1 changed files with 149 additions and 1 deletions
|
|
@ -78,6 +78,16 @@ public sealed class Program
|
|||
/// </remarks>
|
||||
public bool ExpectResource { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the authorization server advertises support for
|
||||
/// <c>offline_access</c> in its <c>scopes_supported</c> metadata. This simulates an OIDC-flavored
|
||||
/// authorization server that issues refresh tokens when the client requests the <c>offline_access</c> scope.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The default value is <c>false</c>.
|
||||
/// </remarks>
|
||||
public bool IncludeOfflineAccessInMetadata { get; set; }
|
||||
|
||||
public HashSet<string> DisabledMetadataPaths { get; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
public IReadOnlyCollection<string> MetadataRequests => _metadataRequests.ToArray();
|
||||
|
||||
|
|
@ -188,7 +198,9 @@ public sealed class Program
|
|||
ResponseTypesSupported = ["code"],
|
||||
SubjectTypesSupported = ["public"],
|
||||
IdTokenSigningAlgValuesSupported = ["RS256"],
|
||||
ScopesSupported = ["openid", "profile", "email", "mcp:tools"],
|
||||
ScopesSupported = IncludeOfflineAccessInMetadata
|
||||
? ["openid", "profile", "email", "mcp:tools", "offline_access"]
|
||||
: ["openid", "profile", "email", "mcp:tools"],
|
||||
TokenEndpointAuthMethodsSupported = ["client_secret_post"],
|
||||
ClaimsSupported = ["sub", "iss", "name", "email", "aud"],
|
||||
CodeChallengeMethodsSupported = ["S256"],
|
||||
|
|
|
|||
Loading…
Reference in a new issue