pub trait AuthProvider: Send + Sync {
// Required method
fn authenticate(
&self,
ctx: &McpContext,
request: AuthRequest<'_>,
) -> Result<AuthContext, McpError>;
}Expand description
Authentication provider interface.
Implementations decide whether a request is allowed and may return
an AuthContext describing the authenticated subject.
Required Methods§
Sourcefn authenticate(
&self,
ctx: &McpContext,
request: AuthRequest<'_>,
) -> Result<AuthContext, McpError>
fn authenticate( &self, ctx: &McpContext, request: AuthRequest<'_>, ) -> Result<AuthContext, McpError>
Authenticate an incoming request.
Return Ok(AuthContext) to allow, or an Err(McpError) to deny.