Authenticator Trait

Overview

The Authenticator trait is the core interface for all authentication providers in lighty-auth. Implement this trait to create custom authentication systems.

Export: lighty_auth::Authenticator

Trait Definition

pub trait Authenticator {
    #[cfg(feature = "events")]
    async fn authenticate(
        &mut self,
        event_bus: Option<&EventBus>,
    ) -> AuthResult<UserProfile>;

    #[cfg(not(feature = "events"))]
    async fn authenticate(&mut self) -> AuthResult<UserProfile>;
}

Implementing Custom Authenticator

Basic Implementation

Usage

Last updated