Skip to content

Commit

Permalink
Add support for Okta question MFA (#151)
Browse files Browse the repository at this point in the history
Co-authored-by: sevignyj <[email protected]>
  • Loading branch information
jonsolakis and sevignyj authored Dec 18, 2023
1 parent dcc4b6a commit dd74bde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/unit/test_okta.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def test_bad_session_token(mocker, sample_json_response, sample_headers):
{"_embedded": {"factor": {"factorType": "push"}}},
345,
), # Changed expected value to 2
("OKTA", 321,{"_embedded": {"factor": {"factorType": "question"}}}, 321),
("GOOGLE", 456, {"_embedded": {"factor": {"factorType": "sms"}}}, 456),
],
)
Expand Down
5 changes: 4 additions & 1 deletion tokendito/okta.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,10 @@ def mfa_provider_type(

elif mfa_provider == "OKTA" and factor_type == "push":
mfa_verify = push_approval(mfa_challenge_url, payload)
elif mfa_provider in ["OKTA", "GOOGLE"] and factor_type in ["token:software:totp", "sms"]:
elif (
(mfa_provider in ["OKTA", "GOOGLE"] and factor_type in ["token:software:totp", "sms"])
or (mfa_provider == "OKTA" and factor_type == "question")
):
mfa_verify = totp_approval(
config, selected_mfa_option, headers, mfa_challenge_url, payload, primary_auth
)
Expand Down

0 comments on commit dd74bde

Please sign in to comment.