Skip to content

Commit

Permalink
Map the notorious AADSTS7000218 to RedirectUriError in this WAM context
Browse files Browse the repository at this point in the history
  • Loading branch information
rayluo committed May 5, 2022
1 parent 9843d6f commit ef7107f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion msal/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def complete(self, result):

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

0 comments on commit ef7107f

Please sign in to comment.