Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #69 from himmelblau-idm/dmulder/fix_consolidated_t…
Browse files Browse the repository at this point in the history
…eliphony

Fix ConsolidatedTelephony unknown auth type
  • Loading branch information
dmulder authored May 30, 2024
2 parents a9a2ec0 + 6be37fb commit a18297b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "msal"
description = "Microsoft Compatible Authentication Library for Rust"
version = "0.2.5"
version = "0.2.6"
edition = "2021"
authors = [
"David Mulder <[email protected]>"
Expand Down
12 changes: 10 additions & 2 deletions src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ impl PublicClientApplication {
"PhoneAppNotification" => format!("Open your Authenticator app, and enter the number '{}' to sign in.", auth_response.entropy),
"PhoneAppOTP" =>
"Please type in the code displayed on your authenticator app from your device:".to_string(),
"OneWaySMS" =>
"ConsolidatedTelephony" | "OneWaySMS" =>
format!("We texted your phone {}. Please enter the code to sign in:", default_auth_method.display),
"TwoWayVoiceMobile" =>
format!("We're calling your phone {}. Please answer it to continue.", default_auth_method.display),
Expand Down Expand Up @@ -1615,9 +1615,17 @@ impl PublicClientApplication {
username: &str,
flow: &MFAAuthContinue,
) -> Result<String, MsalError> {
let mfa_method = match flow.mfa_method.as_str() {
// ConsolidatedTelephony simply means OneWaySMS internally to Azure,
// it seems. If we don't swap them during the ProcessAuth though,
// this request is rejected. I observed this odd behavior in a
// browser auth to Azure also.
"ConsolidatedTelephony" => "OneWaySMS".to_string(),
other => other.to_string(),
};
let params = [
("request", &flow.ctx),
("mfaAuthMethod", &flow.mfa_method),
("mfaAuthMethod", &mfa_method),
("login", &username.to_string()),
("flowToken", &flow.flow_token),
("canary", &flow.canary),
Expand Down

0 comments on commit a18297b

Please sign in to comment.