Error on D365 VM login: AADSTS50011: The redirect URI specified in the request does not match the redirect URIs configured for the application

When trying to connect to the D365FO UI you might get this error:

Transcript of the error message:

Sorry, but we’re having trouble signing you in.AADSTS50011: The redirect URI " https://usnconeboxax1aos.cloud.onebox.dynamics.com/ specified in the request does not match the redirect URIs configured for the application ‘00000015-0000- 0000-c000-000000000000’. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to Error AADSTS50011 the redirect URI does not match the redirect URIs configured for the application | Microsoft Learn to learn more about how to fix this. Troubleshooting details If you contact your administrator, send this info to them. Copy info to clipboard Request Id: c9ca8518-e12e-4e80-b8e6-b8c735bd3b00 Correlation Id: e99029a5-5e27-43d6-854f-f7a2e44f4f66 Timestamp: 2024-11-12T08:14:05Z Message: AADSTS50011: The redirect URI https://usnconeboxax1aos.cloud.onebox.dynamics.com/ " specified in the request does not match the redirect URIs configured for the application ‘00000015-0000-0000-c000- 000000000000’. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to Error AADSTS50011 the redirect URI does not match the redirect URIs configured for the application | Microsoft Learn to learn more about how to fix this. Flag sign-in errors for review: Enable flagging If you plan on getting help for this problem, enable flagging and try to reproduce the error within 20 minutes. Flagged events make diagnostics available and are raised to admin attention.
The temporary solution that was found to work is to change the application ID in the web.config, wif.config and wif.services.config files.

First check what the application ID is for your D365FO application:

Then navigate to AOSService\webroot and locate the web.config, wif.config and wif.services.config files:

Now change the application ID from 00000015-0000- 0000-c000-000000000000 (the one from the error message) to the one that you have found on the Azure portal:



Finally, restart IIS so the changes are applied:

Please be aware that the Docentric SharePoint integration (link) will not work with this temporary fix.

If we find a better, more permanent solution to this, we will add/edit this forum post accordingly.