This message will appear when User Consent Permissions have not been configured to allow a user to give consent for applications to access their mailbox.
To resolve this, an Administrator needs to configure user consent settings in Outlook.
Configure User Consent Settings
1. Sign into your Office365 administrator account.
2. Click Settings > Org Settings.
3. In User consent to apps, ensure checkbox is ticked.
4. Click Save Changes.
An alternative to the above configuration is to consider enabling the admin consent workflow to allow users to request an administrator's review and approval of an application that the user is not allowed to consent to.
Further information about the admin consent workflow can be found on Microsoft's website here: