a4492d4938
JwtBearer 10.0.7 transitively brings in Microsoft.IdentityModel.JsonWebTokens 9.x, which calls Base64UrlEncoder.Decode(ReadOnlySpan<char>, Span<byte>) — an overload only present in Microsoft.IdentityModel.Tokens 9.x. The explicit pin to 8.9.0 forced NuGet to downgrade Tokens to 8.9, producing a runtime MissingMethodException on every JWT validation. Symptom: every incoming request gets 401, never visible at default log level. Drop the explicit pin so JwtBearer's transitive dep wins. The code only uses SymmetricSecurityKey etc., which are stable across versions.
28 lines
1.3 KiB
XML
28 lines
1.3 KiB
XML
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||
|
||
<PropertyGroup>
|
||
<TargetFramework>net10.0</TargetFramework>
|
||
<Nullable>enable</Nullable>
|
||
<ImplicitUsings>enable</ImplicitUsings>
|
||
<RootNamespace>ObsidianMcp</RootNamespace>
|
||
<AssemblyName>obsidian-mcp</AssemblyName>
|
||
</PropertyGroup>
|
||
|
||
<ItemGroup>
|
||
<!-- MCP SDK(Streamable HTTP transport) -->
|
||
<PackageReference Include="ModelContextProtocol" Version="1.0.0" />
|
||
<PackageReference Include="ModelContextProtocol.AspNetCore" Version="1.0.0" />
|
||
<!-- JWT 验签。不显式 pin Microsoft.IdentityModel.Tokens:
|
||
JwtBearer 10.0.7 传递依赖 Microsoft.IdentityModel.JsonWebTokens 9.x,
|
||
JsonWebTokens 9.x 调 Base64UrlEncoder.Decode(ReadOnlySpan, Span),
|
||
该 overload 在 Microsoft.IdentityModel.Tokens 9.x 才加入,显式 pin 8.9.0
|
||
会强制 NuGet downgrade Tokens 到 8.9 → runtime MissingMethodException。
|
||
让 JwtBearer 拉自己的传递依赖即可,代码用的 SymmetricSecurityKey 等
|
||
基础类型在任意版本都可用。 -->
|
||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.7" />
|
||
<!-- glob 匹配 -->
|
||
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="10.0.7" />
|
||
</ItemGroup>
|
||
|
||
</Project>
|