Skip to content

Commit ef7107f

Browse files
committed
Map the notorious AADSTS7000218 to RedirectUriError in this WAM context
1 parent 9843d6f commit ef7107f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

msal/broker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ def complete(self, result):
4545

4646
def _convert_error(error, client_id):
4747
context = error.get_context() # Available since pymsalruntime 0.0.4
48-
if "AADSTS50011" in context: # In WAM, this could happen on both interactive and silent flows
48+
if (
49+
"AADSTS50011" in context # In WAM, this could happen on both interactive and silent flows
50+
or "AADSTS7000218" in context # This "request body must contain ... client_secret" is just a symptom of current app has no WAM redirect_uri
51+
):
4952
raise RedirectUriError( # This would be seen by either the app developer or end user
5053
"MsalRuntime won't work unless this one more redirect_uri is registered to current app: "
5154
"ms-appx-web://Microsoft.AAD.BrokerPlugin/{}".format(client_id))

0 commit comments

Comments
 (0)