Skip to content

Commit f39ce92

Browse files
authored
Fix: Treat IWA as local authentication (#148)
1 parent 66257b7 commit f39ce92

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

tests/unit/test_okta.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ def test_push_approval(mocker, return_value, side_effect, expected):
303303
({}, False),
304304
(None, False),
305305
({"type": "OKTA"}, True),
306+
({"type": "IWA"}, True),
306307
({"type": "SAML2"}, False),
307308
],
308309
)

tokendito/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# vim: set filetype=python ts=4 sw=4
22
# -*- coding: utf-8 -*-
33
"""Tokendito module initialization."""
4-
__version__ = "2.3.2"
4+
__version__ = "2.3.3"
55
__title__ = "tokendito"
66
__description__ = "Get AWS STS tokens from Okta SSO"
77
__long_description_content_type__ = "text/markdown"

tokendito/okta.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,9 @@ def idp_authenticate(config):
686686
# which we then put in our session cookies
687687
create_authn_cookies(config.okta["org"], session_token)
688688
else:
689-
logger.error(f"{auth_properties['type']} login via IdP Discovery is not curretly supported")
689+
logger.error(
690+
f"{auth_properties['type']} login via IdP Discovery is not currently supported"
691+
)
690692
sys.exit(1)
691693

692694

@@ -850,8 +852,10 @@ def local_authentication_enabled(auth_properties):
850852
:param auth_properties: auth_properties dict
851853
:return: True if this is the place to authenticate, False otherwise.
852854
"""
855+
# IWA (https://help.okta.com/en-us/content/topics/directory/ad-iwa-learn.htm)
856+
# should be treated as local authentication
853857
try:
854-
if auth_properties["type"] == "OKTA":
858+
if auth_properties["type"] == "OKTA" or auth_properties["type"] == "IWA":
855859
return True
856860
except (TypeError, KeyError):
857861
pass

0 commit comments

Comments
 (0)