Skip to main content

AuthProvider

Trait AuthProvider 

Source
pub trait AuthProvider: Send + Sync {
    // Required method
    fn authenticate(
        &self,
        ctx: &McpContext,
        request: AuthRequest<'_>,
    ) -> McpResult<AuthContext>;
}
Expand description

Authentication provider interface.

Implementations decide whether a request is allowed and may return an AuthContext describing the authenticated subject.

Required Methods§

Source

fn authenticate( &self, ctx: &McpContext, request: AuthRequest<'_>, ) -> McpResult<AuthContext>

Authenticate an incoming request.

Return Ok(AuthContext) to allow, or an Err(McpError) to deny.

Implementors§