Inbound Email Microsoft OAuth Redirect URI doesn't allow query string

Anyone else run into this?

The docs are outdated. Microsoft must have changed the rules about Redirect URIs since they were written up. RewriteRule now required to get it to work!

When you login to the Azure Portal, do the steps for Microsoft OAuth setup for Inbound Email, and enter the Redirect URI, as shown in the docs, https://my-suitecrm.com/index.php?entryPoint=setExternalOAuthToken, it shows this error:

Failed to update SuiteCRM application. Error detail: URL may not contain a query string. [V/qPTX0wpr9g0xgdOiR105]

Solution, Suite should auto generate a RewriteRule in .htaccess to convert a Redirect URI such as https://my-suitecrm.com/setExternalOAuthToken without the query string, into a URL with the query string Suite requires: https://my-suitecrm.com/index.php?entryPoint=setExternalOAuthToken.

Have you got any solution ?

I propose a solution in this thread, with a link to its github PR: