Troubleshoot the 401 Invalid username/password error in the Microsoft Intune spokeIssue The Get Managed Device action in the Microsoft Intune spoke returns a 401 error. The Microsoft Intune spoke needs the correct permissions in Azure. If the Azure configuration is incorrect or incomplete, the instance can still retrieve the Access Token from the Azure token provider endpoint. The Flow or Action then fails when it runs. The Get Managed Device action shows the following error: Method failed: (/v1.0/deviceManagement/managedDevices/{managedDeviceId}) with code: 401 - Invalid username/password combo The corresponding REST Response shows a message that contains the following error: An error has occurred - Operation ID (for customer support) Release Any Cause The Azure AD account that generates the Access Token is missing a role. As the Microsoft documentation states, all Intune permission scopes require administrator access. This means the account needs the corresponding credentials when running apps or scripts that access Intune API resources. See Intune permission scopes in Related Links. Resolution Review the following roles and settings for the Azure AD account that requests the token: 1.Assign a role to the Azure AD account that requests the token. •Read only Operator is the lowest role that works for look up or get actions. •Global Administrator or Intune Administrator, along with readwrite.all permissions, are needed for Update Managed Device and Delete Managed Device actions. 2.In the instance, configure the Microsoft Intune as an OAuth provider record with Grant Type Authorization Code. 3.Review the permissions for each Intune spoke action in the Intune spoke actions permission table (KB0995339). Permissions can be of type Delegated or Application, depending on the use case. 4.Add the following basic Microsoft Graph permissions to the previous permissions: •email - View users' email address •offline_access - Maintain access to data you have given it access to •openid - Sign users in •profile - View users' basic profile •User.Read - Sign in and read user profile Related Links •Read the Intune spoke setup documentation (ServiceNow product documentation) •Review the Intune spoke actions permission table (KB0995339) •Review Intune permission scopes in Microsoft documentation (Microsoft documentation)