I don’t know if anything has changed recently, but after following the guide on integrating ms office AAD auth to erpnext, I am getting AADSTS90102: ‘redirect_uri’ value must be a valid absolute URI.
I even gave all 3 forms of email access as suggested in this discussion:
I tried a lot of things, but still haven’t been able to fix this issue. One reason I think could be happening is the redirect URI being sent from the side of erpnext is not https and also for some reason the http word gets repeated twice in the url. Also the baseurl (office.prishapolicy.com) isn’t even mentioned in the redirect URI. Here you can see the redirect uri encoded in the flow:
I finally kind of solved this by changing the site configurations of the erp installation.
Disclosure : I am an absolute beginner in ERPNext and this install has been hosted on azure using a bitnami installer, so your file structure and overall system might vary slightly.
But these are my two main config files which were used to fix the auth flow.
Notice that i changed webserver_port from the default value of 8000 to an empty string. I don’t know if doing this was entirely safe but this was the only way to make the redirect_uri not mention the port number, I got the idea to do this from Google Settings Error: redirect_uri_mismatch and Configuration
Yes, that worked. The key is the “host_name”: “https://office.prishapolicy.com" setting, other wise the local DNS setting is used, which in shared environments is not necessary the same as the registered domain!