Views:

Behavior: 
When setting up Oauth2, the login screen for Microsoft automatically redirects to a Microsoft user account that is already logged in rather than the one you want to set up.

Solution: 
This issue is often caused by a cached user account. When a user logs in to Microsoft services, the browser caches their credentials to make it easier to log in again later. However, this can cause issues when setting up Oauth2 for a different user account.

Using Incognito Mode when configuring Oauth2:
As a workaround to this issue, use an incognito window for the step of the Oauth2 configuration where you need to log in. An incognito window is a private browsing mode that does not cache data or cookies from previous browsing sessions.

To use an incognito window, open your browser and navigate to the login screen for the Microsoft account you want to use for Oauth2. Then, open an incognito window using the appropriate keyboard shortcut or menu option for your browser (In many browsers, this is Ctrl+Shift+N). In the incognito window, navigate to the Oauth2 setup page and log in using the desired Microsoft account. Once the Oauth2 configuration is complete, you can close the incognito window and return to normal browsing mode.

For Cloud organizations, this behavior can also occur when using our built-in Exchange Online mail service, which allows connection via the Connect to Microsoft button. This would be configured in the General Email plugin, using the Connect an email account link. Using Incognito mode when configuring Oauth2 will also alleviate this behavior in this scenario.

KBA is applicable for both Cloud and On-premise Organizations.