Skip to content

Commit 1c46359

Browse files
committed
update to raise other errors instead of redirecting loop
1 parent 4a92ef1 commit 1c46359

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ms_identity_web/__init__.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -124,24 +124,28 @@ def process_auth_redirect(self, redirect_uri: str = None, response_type: str = N
124124
except AuthSecurityError as ase:
125125
self.remove_user()
126126
self._logger.error(f"process_auth_redirect: security violation {ase.args}")
127+
raise ase
127128
except OtherAuthError as oae:
128129
self.remove_user()
129130
self._logger.error(f"process_auth_redirect: other auth error {oae.args}")
131+
raise oae
130132
except B2CPasswordError as b2cpwe:
131133
self.remove_user()
132134
self._logger.error(f"process_auth_redirect: b2c pwd {b2cpwe.args}")
133135
pw_reset_url = self.get_auth_url(redirect_uri=redirect_uri, b2c_policy = self.aad_config.b2c.password)
134136
return self._adapter.redirect_to_absolute_url(pw_reset_url)
137+
# don't raise
135138
except TokenExchangeError as ter:
136139
self.remove_user()
137140
self._logger.error(f"process_auth_redirect: token xchange {ter.args}")
141+
raise ter
138142
except BaseException as other:
139143
self.remove_user()
140144
self._logger.error(f"process_auth_redirect: unknown error{other.args}")
141-
finally:
142-
self._logger.info("process_auth_redirect: exiting auth code method. redirecting... ")
145+
raise other
143146

144147
#TODO: GET /auth/redirect?error=interaction_required&error_description=AADB2C90077%3a+User+does+not+have+an+existing+session+and+request+prompt+parameter+has+a+value+of+%27None%27.
148+
self._logger.info("process_auth_redirect: exiting auth code method. redirecting... ")
145149
return self._adapter.redirect_to_absolute_url(afterwards_go_to_url)
146150

147151
@require_context_adapter

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup, find_packages
22

33
setup(name='ms_identity_web',
4-
version='0.16.5',
4+
version='0.16.6',
55
description='MSAL Identity Utilities',
66
author='Azure Samples',
77
url='https://github.com/azure-samples/ms-identity-python-utilities',

0 commit comments

Comments
 (0)