From 27539429f7225979b312153112bb1c24abbbcaa6 Mon Sep 17 00:00:00 2001 From: Kai Jan Kriegel Date: Wed, 16 Mar 2022 05:42:19 +0100 Subject: [PATCH] enable mutistage auth --- src/api/auth.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/api/auth.rs b/src/api/auth.rs index ccc2a2b..041aa8b 100644 --- a/src/api/auth.rs +++ b/src/api/auth.rs @@ -95,12 +95,9 @@ impl Callback for CB { ) -> Result<(), SessionError> { match property { fabfire::FABFIRECARDKEY => { - // Access the authentication id, i.e. the username to check the password for let authcid = session.get_property_or_callback::()?; - println!("auth'ing user {:?}", authcid); self.userdb.get_user(authcid.unwrap().as_ref()).map(|user| { let kvs= user.unwrap().data.kv; - println!("kvs: {:?}", kvs); kvs.get("cardkey").map(|key| { session.set_property::(Arc::new(<[u8; 16]>::try_from(hex::decode(key).unwrap()).unwrap())); }); @@ -205,8 +202,8 @@ impl authentication::Server for Auth { } Ok(Step::NeedsMore(_)) => { trace!(self.log, "Authentication wants more data"); - self.state = State::Aborted; - self.build_error(builder); + builder.set_challenge(&out.get_ref()); + self.state = State::Running(session); } Err(error) => { trace!(self.log, "Authentication errored: {}", error);