Skip to content

Commit

Permalink
Fix: Treat IWA as local authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
pcmxgti committed Dec 6, 2023
1 parent 66257b7 commit 35629ce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/unit/test_okta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
)
Expand Down
2 changes: 1 addition & 1 deletion tokendito/__init__.py
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 6 additions & 2 deletions tokendito/okta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


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

0 comments on commit 35629ce

Please sign in to comment.