nat.front_ends.mcp.introspection_token_verifier#

OAuth 2.0 Token Introspection verifier implementation for MCP servers.

Attributes#

Classes#

IntrospectionTokenVerifier

Token verifier that delegates token verification to BearerTokenValidator.

Module Contents#

logger#
class IntrospectionTokenVerifier(
config: nat.authentication.oauth2.oauth2_resource_server_config.OAuth2ResourceServerConfig,
)#

Bases: mcp.server.auth.provider.TokenVerifier

Token verifier that delegates token verification to BearerTokenValidator.

Create IntrospectionTokenVerifier from OAuth2ResourceServerConfig.

Args:

config: OAuth2ResourceServerConfig

_bearer_token_validator#
async verify_token(
token: str,
) mcp.server.auth.provider.AccessToken | None#

Verify token by delegating to BearerTokenValidator.

Args:

token: The Bearer token to verify

Returns:

AccessToken | None: AccessToken if valid, None if invalid