External idp integration

From RedHatProductSecurity/prodsec-skills · View interactive version

External idp integration is an AI agent skill from the GitHub repository RedHatProductSecurity/prodsec-skills. Enforce MCP server integration with external centralized identity providers. Use when building, configuring, or reviewing MCP server authentication against external IdPs like Keycloak.

How to use this skill

Skill file

External IdP Integration for MCP Servers

Security Requirement

MCP servers MUST be capable of integrating with centralized identity providers (e.g., Keycloak) for authentication and authorization. The MCP server should not implement its own user store but delegate identity management to an external IdP.

Why External IdP

| Benefit | Description |

|---|---|

| Centralized identity | Single source of truth for user and service identities |

| Standard protocols | OIDC/OAuth 2.1 compliance out of the box |

| Enterprise features | MFA, federation, session management handled by IdP |

| Reduced attack surface | MCP server does not store credentials |

| Consistent policy | Same authentication policies across all services |

Integration Requirements

The MCP server must:

  1. Discover the IdP via standard metadata endpoints (/.well-known/openid-configuration or /.well-known/oauth-authorization-server)
  2. Validate tokens issued by the IdP (JWT signature verification against JWKS)
  3. Accept tokens from the configured IdP(s) only
  4. Allow configuration of the trusted IdP issuer URL

Example Configuration

auth:
  idp:
    issuer: "https://keycloak.example.com/realms/mcp"
    jwks_uri: "https://keycloak.example.com/realms/mcp/protocol/openid-connect/certs"
    audience: "mcp-server"
  require_auth: true

Implementation Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.