activities
latest
false
UiPath logo, featuring letters U and I in white

Productivity Activities

Last updated Oct 21, 2025

AADSTS65004: User declined to consent to access the app

Issue

When using the username and password authentication with Microsoft 365 Scope, you may encounter the error: AADSTS65004: User declined to consent to access the app. Bad Request: You must provide an OAuth code in order to create a connection to this application.

The error occurs during execution when your activity attempts to establish a connection through an OAuth flow that requires user consent. The user declines the consent prompt, so the OAuth flow cannot proceed, leading to the error.

Solution

In the properties panel of the activity you added in the Microsoft 365 Scope, check the box for Use Integration Service. This allows you to use the Integration Service connection that is already authenticated.

  • Issue
  • Solution

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo
Trust and Security
© 2005-2025 UiPath. All rights reserved.