Enabling non-standard ports for on-prem using OAuth#517
Enabling non-standard ports for on-prem using OAuth#517korytiak wants to merge 3 commits intomicrosoft:masterfrom
Conversation
…ise options for on-prem OAuth service client are very limited On-prem deployment very often use non-standard ports like 444
Update ConnectionService.cs to allow on-prem ports with OAuth
There was a problem hiding this comment.
I do not believe your change does what you think it does.
On line 1476, the Uri.DnsSafeHost property, just like the Uri.Host property, returns only the host portion of the URI, so even if _targetInstanceUriToConnectTo contains your port 444, it would still be stripped out of the URI generated here.
There was a problem hiding this comment.
Thank you for explaining the issue with my change. Would updating the .DnsSafeHost to .Authority (which would preserve the port) work as a potential workaround to allow the on-prem usage, or do you see any issue with that? Base on your feeling about this, please reject/accept the PR. Thank you again for your time and correction either way!
…preserve the port for on-prem hosts

Hello my team has been struggling adopt the new ServiceClient as we're very restricted with our old on-prem setup. We've made some advances, and are getting closer, however the best thing we can do is use the ServiceClient constructior that takes url and tokenProviderFunction. This is really the best way for us to use new ServiceClient + OAuth we've set up, however it rewrites our port 444 to 443 and that breaks the client. Thank you for considering this fix.