Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ private async Task<IOrganizationService> DoDirectLoginAsync(bool IsOnPrem = fals

IOrganizationService dvService = null;
Uri OrgWorkingURI = null;
if (!IsOnPrem || _eAuthType == AuthenticationType.OAuth) // Use this even if its onPrem, when auth type == oauth.
if (!IsOnPrem)
{
OrgWorkingURI = new Uri(string.Format(SoapOrgUriFormat, _targetInstanceUriToConnectTo.Scheme, _targetInstanceUriToConnectTo.DnsSafeHost));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

}
Expand Down