githubEdit

shield-halvedOAuth Providers

Configure OAuth authentication for MCP servers.

Overview

OAuth Providers enable:

  • Secure authentication for MCP servers

  • Third-party service access

  • Token management

  • Multi-provider support

  • Refresh token handling

Basic Setup

Register OAuth Provider

var mcpController = agent.MCPController;

mcpController.RegisterOAuthProvider(new OAuthProviderConfig
{
    ProviderId = "github",
    ClientId = "your-client-id",
    ClientSecret = "your-client-secret",
    AuthorizationEndpoint = "https://github.com/login/oauth/authorize",
    TokenEndpoint = "https://github.com/login/oauth/access_token",
    Scopes = new[] { "repo", "user" }
});

Provider Configuration

GitHub OAuth

Google OAuth

Slack OAuth

OAuth Flow

Authorization Flow

Token Management

Store Access Tokens

Refresh Tokens

Auto-Refresh

Multi-Provider Support

Provider Manager

Security

Secure Token Storage

Validate Scopes

Error Handling

Handle OAuth Errors

Complete Example

Next Steps

Last updated