From 39fb4f6aeaf6c04d9a142c61dbb22f0cc2c202a0 Mon Sep 17 00:00:00 2001 From: pcmxgti <16561338+pcmxgti@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:23:37 -0500 Subject: [PATCH] Fix: Treat IWA as local authentication --- tests/unit/test_okta.py | 1 + tokendito/__init__.py | 2 +- tokendito/okta.py | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_okta.py b/tests/unit/test_okta.py index 8a32ebe..4bddcd5 100644 --- a/tests/unit/test_okta.py +++ b/tests/unit/test_okta.py @@ -303,6 +303,7 @@ def test_push_approval(mocker, return_value, side_effect, expected): ({}, False), (None, False), ({"type": "OKTA"}, True), + ({"type": "IWA"}, True), ({"type": "SAML2"}, False), ], ) diff --git a/tokendito/__init__.py b/tokendito/__init__.py index 2f15352..d8c54dd 100644 --- a/tokendito/__init__.py +++ b/tokendito/__init__.py @@ -1,7 +1,7 @@ # vim: set filetype=python ts=4 sw=4 # -*- coding: utf-8 -*- """Tokendito module initialization.""" -__version__ = "2.3.2" +__version__ = "2.3.3" __title__ = "tokendito" __description__ = "Get AWS STS tokens from Okta SSO" __long_description_content_type__ = "text/markdown" diff --git a/tokendito/okta.py b/tokendito/okta.py index 541f135..cf0994f 100644 --- a/tokendito/okta.py +++ b/tokendito/okta.py @@ -686,7 +686,9 @@ def idp_authenticate(config): # which we then put in our session cookies create_authn_cookies(config.okta["org"], session_token) else: - logger.error(f"{auth_properties['type']} login via IdP Discovery is not curretly supported") + logger.error( + f"{auth_properties['type']} login via IdP Discovery is not currently supported" + ) sys.exit(1) @@ -851,7 +853,7 @@ def local_authentication_enabled(auth_properties): :return: True if this is the place to authenticate, False otherwise. """ try: - if auth_properties["type"] == "OKTA": + if auth_properties["type"] == "OKTA" or auth_properties["type"] == "IWA": return True except (TypeError, KeyError): pass