UiPath Office365 Activity Error: AADSTS50079 The User is required to use Multi-Factor Authentication

When running the UiPath Office365 activity the following error is displayed: ErrorCode invalid_grant MsalUiRequiredException AADSTS50079 The user is required to use multi-factor authentication.

When this error is displayed whilst using the UiPath Office365 Activity it means that a non-interactive flow is used to authenticate against Azure, Username + Password or Windows Integrated Authentication, and the tenant admin of the organization has chosen to oblige users to perform multi-factor authentication.

For this scenario there are two possible solutions:

  • Use an Interactive Flow, to display the pop-up and perform the Multi-factor Authentication.
  • Disable Multi-Factor Authentication for that particular account, if a non-interactive flow needs to be used. Multi-Factor authentication with a non-interactive flow cannot be performed and there is no work-around or solution for that flow.