Error accessing Website Microsoft Dynamics NAV 2017 Web Client Raw Url: /company/WebClient/SignIn.aspx?ReturnUrl=blahblah Url: https://www.someurl.com/company/WebClient/SignIn.aspx?ReturnUrl=blahblah Type: System.InvalidOperationException Message: This operation is not supported for a relative URI. StackTrace: at System.Uri.get_Query() at Microsoft.Dynamics.Framework.UI.Web.FederatedAuthenticationUrlRewriter.CalculateReply(Uri originalRequestUri, Uri authUri, String replyQuery) at Microsoft.Dynamics.Framework.UI.Web.FederatedAuthenticationUrlRewriter.RewriteAcsUri(Uri originalRequestUri, Uri acsUri) at Microsoft.Dynamics.Nav.WebClient.Security.AcsAuthenticationProvider.Authenticate(HttpContextBase context, String userName, String password) at Microsoft.Dynamics.Nav.Client.WebClient.SignIn.Authenticate() at Microsoft.Dynamics.Nav.Client.WebClient.SignIn.SetAuthenticationProvider() at Microsoft.Dynamics.Nav.Client.WebClient.SignIn.OnInitCore(EventArgs e) Source: System
if (!HttpUtility.ParseQueryString(authUri.Query).AllKeys.Contains<string>(replyQuery, StringComparer.OrdinalIgnoreCase))
https://login.windows.net/tenant-is-here.onmicrosoft.com/wsfed?etc-etc-etc
Answers
The web client appears to draw its settings from the service tier configuration provider in NAV2017 and later.
The only reason I found this out was copying a config from a working customer over and forgetting to change the server name that pointed to the NST. The web.config kicked in and it started redirecting to the O365 sign in page.
When I put the correct server/NST name in it started throwing the error. It turns out the NST settings were not correct (but I had assumed it would ignore the NST settings and just use the web config)
I'm pretty sure it doesn't do this in 2016 so it's a little frustrating that it's not documented (as far as I can see).