cxxmcp 1.1.6
C++ MCP SDK
Loading...
Searching...
No Matches
mcp::server::StaticBearerAuthProvider Class Referencefinal

Static bearer-token AuthProvider for small embedded deployments and tests. More...

#include <auth.hpp>

Inheritance diagram for mcp::server::StaticBearerAuthProvider:
mcp::server::AuthProvider

Classes

struct  Entry
 

Public Member Functions

 StaticBearerAuthProvider (std::vector< Entry > entries)
 
void add_token (std::string token, AuthIdentity identity)
 
core::Result< AuthIdentityauthenticate (const AuthRequest &request) override
 Authenticate a transport request.
 

Detailed Description

Static bearer-token AuthProvider for small embedded deployments and tests.

This provider validates Authorization: Bearer <token> against an in-memory token table and returns the configured identity. It is intentionally narrow: production OAuth/DPoP deployments should use an application-specific provider or the future OpenSSL/JWKS-backed provider.

Member Function Documentation

◆ authenticate()

core::Result< AuthIdentity > mcp::server::StaticBearerAuthProvider::authenticate ( const AuthRequest request)
inlineoverridevirtual

Authenticate a transport request.

Parameters
requestHeaders and remote metadata to evaluate.
Returns
AuthIdentity on success, or a core::Error describing denial or provider failure.
Note
Implementations may be called concurrently by transports that dispatch requests on multiple threads.

Implements mcp::server::AuthProvider.


The documentation for this class was generated from the following file: