Skip to content

Commit

Permalink
Additional debug for Hello auth
Browse files Browse the repository at this point in the history
Signed-off-by: David Mulder <[email protected]>
  • Loading branch information
dmulder committed Apr 12, 2024
1 parent 9a23aba commit 52a2aa2
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions src/common/src/idprovider/himmelblau.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,23 @@ impl IdProvider for HimmelblauProvider {

match self.token_validate(account_id, &token).await {
Ok(AuthResult::Success { token }) => {
debug!("Returning user token from successful Hello PIN setup and authentication.");
Ok((AuthResult::Success { token }, AuthCacheAction::None))
}
/* This should never happen. It doesn't make sense to
* continue from a Pin auth. */
Ok(AuthResult::Next(_)) => Err(IdpError::BadRequest),
Ok(auth_result) => Ok((auth_result, AuthCacheAction::None)),
Err(e) => Err(e),
Ok(AuthResult::Next(_)) => {
debug!("Invalid additional authentication requested with Hello auth.");
Err(IdpError::BadRequest)
}
Ok(auth_result) => {
debug!("Hello auth failed.");
Ok((auth_result, AuthCacheAction::None))
}
Err(e) => {
error!("Error encountered during Hello auth: {:?}", e);
Err(e)
}
}
}
(AuthCredHandler::Pin, PamAuthRequest::Pin { cred }) => {
Expand Down Expand Up @@ -647,13 +657,23 @@ impl IdProvider for HimmelblauProvider {

match self.token_validate(account_id, &token).await {
Ok(AuthResult::Success { token }) => {
debug!("Returning user token from successful Hello PIN authentication.");
Ok((AuthResult::Success { token }, AuthCacheAction::None))
}
/* This should never happen. It doesn't make sense to
* continue from a Pin auth. */
Ok(AuthResult::Next(_)) => Err(IdpError::BadRequest),
Ok(auth_result) => Ok((auth_result, AuthCacheAction::None)),
Err(e) => Err(e),
Ok(AuthResult::Next(_)) => {
debug!("Invalid additional authentication requested with Hello auth.");
Err(IdpError::BadRequest)
}
Ok(auth_result) => {
debug!("Hello auth failed.");
Ok((auth_result, AuthCacheAction::None))
}
Err(e) => {
error!("Error encountered during Hello auth: {:?}", e);
Err(e)
}
}
}
(AuthCredHandler::Password, PamAuthRequest::Password { cred }) => {
Expand Down

0 comments on commit 52a2aa2

Please sign in to comment.