Desktop flow invalid credentials error when you use a Microsoft Entra account

This article provides a resolution for the InvalidConnectionCredentials or WindowsIdentityIncorrect error code that occurs when you run a desktop flow using a Microsoft Entra account.

Applies to:   Power Automate
Original KB number:   4555623

Symptoms

When you run a desktop flow using a Microsoft Entra account, it fails with the InvalidConnectionCredentials or WindowsIdentityIncorrect error code.

{
    "error":{
        "code": "InvalidConnectionCredentials",
        "message": "Could not connect to the Power Automate UI flows Agent. Please make sure that the UI flows connection credentials are valid."
    }    
}
{
    "error":{
        "code": "WindowsIdentityIncorrect",
        "message": "The credentials provided with the request are invalid."
    }    
}

Cause

You might encounter the error when using a Microsoft Entra account for several reasons:

Resolution

  1. Ensure that the device is Microsoft Entra joined or domain-joined:

    1. Open a command prompt.

    2. Run the dsregcmd /status command.

    3. Check the Device State section.

      Screenshot of the device state in the command prompt when running dsregcmd /status.

      Make sure that one of the DomainJoined or AzureAdJoined values is YES.

      If this isn't the case, a Microsoft Entra account can't be used unless the device is joined. For more information, see How to join a device.

  2. Identify the Microsoft Entra account to use in the machine configuration:

    1. Open Settings and select Accounts.

    2. Select Access work or school.

    3. Make sure you see text like "Connected to <your_organization> Microsoft Entra ID." The account it's connected to can be used in the connection.

  3. Synchronize the Microsoft Entra account on the device:

    1. Select the Info button when selecting your Microsoft Entra connection on the Access work or school page.

    2. This will open a page that describes your connection information and device synchronization status. Select the Sync button at the end of the page, and wait for this process to complete.

  4. Verify that the configured Microsoft Entra account can sign in to the device:

    1. Try to sign in to the machine using the Microsoft Entra account identified in step 2.
    2. The device login must be successful in order to be used in a connection.
  5. Make sure the flow is configured properly with the right username and password. This must match the account on your computer.

More information