mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-22 06:47:56 +01:00
enable mutistage auth
This commit is contained in:
parent
c317101b93
commit
27539429f7
@ -95,12 +95,9 @@ impl Callback for CB {
|
|||||||
) -> Result<(), SessionError> {
|
) -> Result<(), SessionError> {
|
||||||
match property {
|
match property {
|
||||||
fabfire::FABFIRECARDKEY => {
|
fabfire::FABFIRECARDKEY => {
|
||||||
// Access the authentication id, i.e. the username to check the password for
|
|
||||||
let authcid = session.get_property_or_callback::<AuthId>()?;
|
let authcid = session.get_property_or_callback::<AuthId>()?;
|
||||||
println!("auth'ing user {:?}", authcid);
|
|
||||||
self.userdb.get_user(authcid.unwrap().as_ref()).map(|user| {
|
self.userdb.get_user(authcid.unwrap().as_ref()).map(|user| {
|
||||||
let kvs= user.unwrap().data.kv;
|
let kvs= user.unwrap().data.kv;
|
||||||
println!("kvs: {:?}", kvs);
|
|
||||||
kvs.get("cardkey").map(|key| {
|
kvs.get("cardkey").map(|key| {
|
||||||
session.set_property::<FabFireCardKey>(Arc::new(<[u8; 16]>::try_from(hex::decode(key).unwrap()).unwrap()));
|
session.set_property::<FabFireCardKey>(Arc::new(<[u8; 16]>::try_from(hex::decode(key).unwrap()).unwrap()));
|
||||||
});
|
});
|
||||||
@ -205,8 +202,8 @@ impl authentication::Server for Auth {
|
|||||||
}
|
}
|
||||||
Ok(Step::NeedsMore(_)) => {
|
Ok(Step::NeedsMore(_)) => {
|
||||||
trace!(self.log, "Authentication wants more data");
|
trace!(self.log, "Authentication wants more data");
|
||||||
self.state = State::Aborted;
|
builder.set_challenge(&out.get_ref());
|
||||||
self.build_error(builder);
|
self.state = State::Running(session);
|
||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
trace!(self.log, "Authentication errored: {}", error);
|
trace!(self.log, "Authentication errored: {}", error);
|
||||||
|
Loading…
Reference in New Issue
Block a user