@@ -15,7 +15,6 @@ namespace ModelContextProtocol.AspNetCore.Authentication;
1515public class McpAuthenticationHandler : AuthenticationHandler < McpAuthenticationOptions > , IAuthenticationRequestHandler
1616{
1717 private readonly IOptionsMonitor < McpAuthenticationOptions > _optionsMonitor ;
18- private string _resourceMetadataPath ;
1918
2019 /// <summary>
2120 /// Initializes a new instance of the <see cref="McpAuthenticationHandler"/> class.
@@ -27,16 +26,6 @@ public McpAuthenticationHandler(
2726 : base ( options , logger , encoder )
2827 {
2928 _optionsMonitor = options ;
30-
31- // Note: this.Options is not fully available here.
32- // _resourceMetadataPath will be correctly updated by GetAbsoluteResourceMetadataUri
33- // or can be fetched from this.Options directly in HandleRequestAsync if needed.
34- // For initial setup, if ResourceMetadataUri can be different per scheme,
35- // this might need to be deferred or handled carefully.
36- // However, GetAbsoluteResourceMetadataUri which is called by HandleChallengeAsync
37- // will use this.Options and update _resourceMetadataPath.
38- // And HandleResourceMetadataRequestAsync will also use this.Options.
39- _resourceMetadataPath = options . CurrentValue . ResourceMetadataUri ? . ToString ( ) ?? string . Empty ;
4029 }
4130
4231 /// <inheritdoc />
@@ -76,12 +65,7 @@ private string GetAbsoluteResourceMetadataUri()
7665 var options = this . Options ;
7766 var resourceMetadataUri = options . ResourceMetadataUri ;
7867
79- // If the options have changed, update the cached path
8068 string currentPath = resourceMetadataUri ? . ToString ( ) ?? string . Empty ;
81- if ( _resourceMetadataPath != currentPath && resourceMetadataUri != null )
82- {
83- _resourceMetadataPath = resourceMetadataUri . IsAbsoluteUri ? currentPath : resourceMetadataUri . OriginalString ;
84- }
8569
8670 if ( resourceMetadataUri != null && resourceMetadataUri . IsAbsoluteUri )
8771 {
0 commit comments