Implementing OAuth 2.0 Authentication for MCP Endpoint in ASP.NET Core #454
Unanswered
Gopichandar
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Question Category
Your Question
ello everyone,
I'm working on an ASP.NET Core application where I need to secure the MCP (Model Context Protocol) endpoint using OAuth 2.0 authentication. Currently, the application uses cookie-based authentication for user login, but I want to transition to OAuth 2.0 to enhance security and allow integration with external identity providers.
Here's the current setup for cookie-based authentication:
csharp
And the MCP endpoint is configured as follows:
csharp
I want to replace the cookie-based authentication with OAuth 2.0, possibly using JWT bearer tokens, to secure the /sse endpoint provided by MapMcp(). I'm looking for guidance on:
Configuring the ASP.NET Core application to use OAuth 2.0 authentication.
Protecting the MCP endpoint with OAuth 2.0.
Handling token validation and authorization policies.
Any best practices or considerations when implementing OAuth 2.0 in this context.
Has anyone implemented OAuth 2.0 authentication for an MCP endpoint in ASP.NET Core? Any code examples, tutorials, or references would be greatly appreciated.
Thank you in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions