pub struct WebAuthnService<S> { /* private fields */ }Expand description
WebAuthn/passkey service powered by webauthn-rs.
Registration/authentication states are held server-side in memory and expire by TTL. Registered passkeys are persisted in credential metadata.
Implementations§
Source§impl<S> WebAuthnService<S>
impl<S> WebAuthnService<S>
pub fn new( storage: S, rp_id: impl Into<String>, rp_origin: impl Into<String>, challenge_ttl: Duration, session_ttl_secs: i64, ) -> Result<Self>
pub async fn begin_registration( &self, user_id: Uuid, ) -> Result<WebAuthnBeginResponse>
pub async fn finish_registration( &self, req: FinishRegistrationRequest, ) -> Result<WebAuthnRegistrationResult>
pub async fn begin_authentication( &self, user_id: Uuid, ) -> Result<WebAuthnBeginResponse>
pub async fn finish_authentication( &self, req: FinishAuthenticationRequest, ) -> Result<WebAuthnAuthenticationResult>
Auto Trait Implementations§
impl<S> Freeze for WebAuthnService<S>where
S: Freeze,
impl<S> RefUnwindSafe for WebAuthnService<S>where
S: RefUnwindSafe,
impl<S> Send for WebAuthnService<S>where
S: Send,
impl<S> Sync for WebAuthnService<S>where
S: Sync,
impl<S> Unpin for WebAuthnService<S>where
S: Unpin,
impl<S> UnsafeUnpin for WebAuthnService<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for WebAuthnService<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more