Skip to content

Commit b5a1bfd

Browse files
committed
Fix README
1 parent f47ad26 commit b5a1bfd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/ModelContextProtocol.AspNetCore/HttpMcpSession.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ public HttpMcpSession(SseResponseStreamTransport transport, ClaimsPrincipal user
1212
}
1313

1414
public SseResponseStreamTransport Transport { get; }
15-
public (string ClaimType, string ClaimValue)? UserIdClaim { get; }
15+
public (string ClaimType, string ClaimValue, string Issuer)? UserIdClaim { get; }
1616

1717
public bool HasSameUserId(ClaimsPrincipal user)
1818
=> UserIdClaim?.ClaimValue == GetUserIdClaim(user)?.ClaimValue;
1919

2020
// SignalR only checks for ClaimTypes.NameIdentifier in HttpConnectionDispatcher, but AspNetCore.Antiforgery checks that plus the sub and UPN claims.
2121
// However, we short-circuit unlike antiforgery since we expect to call this to verify MCP messages a lot more frequently than
2222
// verifying antiforgery tokens from <form> posts.
23-
private static (string ClaimType, string ClaimValue)? GetUserIdClaim(ClaimsPrincipal user)
23+
private static (string ClaimType, string ClaimValue, string Issuer)? GetUserIdClaim(ClaimsPrincipal user)
2424
{
2525
if (user?.Identity?.IsAuthenticated != true)
2626
{
@@ -31,7 +31,7 @@ private static (string ClaimType, string ClaimValue)? GetUserIdClaim(ClaimsPrinc
3131

3232
if (claim is { } idClaim)
3333
{
34-
return (idClaim.Type, idClaim.Value);
34+
return (idClaim.Type, idClaim.Value, idClaim.Issuer);
3535
}
3636

3737
return null;

src/ModelContextProtocol.AspNetCore/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dotnet add package ModelContextProtocol.AspNetCore --prerelease
3030

3131
```csharp
3232
// Program.cs
33-
?using ModelContextProtocol.Server;
33+
using ModelContextProtocol.Server;
3434
using System.ComponentModel;
3535

3636
var builder = WebApplication.CreateBuilder(args);

0 commit comments

Comments
 (0)