Hey there,
I'm currently working on a very curious problem with one of our applications.
I have 2 browsers open to simulate 2 customers, both on-prem.
Short version to log in the first guy I do
ConfigFile.WebServices.RemoteBaseURL = "host/remote/services82";
ConfigFile.Services.ApplicationToken = "123";
ConfigFile.Services.DefaultMode = ServiceMode.Remote;
SoSession.Authenticate("user","pass");
This works correctly.
Now the second user tries to log in and the code goes:
ConfigFile.WebServices.RemoteBaseURL = "NEW-HOST/remote/services84";
SoSession.Authenticate("new-user","new-pass");
This does not work.
I also tried clearing out the session prior to the new request:
SoContext.CloseCurrentSession();
HttpContext.Current.Session.Abandon()
Didn't help.
Upon further inspection of the SOAP package sent for the second request I can see that it sent a package with the expectation of working with a services82 endpoint as it did with the first user, even though the RemoteBaseURL is a services84 endpoint.
POST https://customerHost/Remote/Services84/SoPrincipal.svc HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.superoffice.net/ws/crm/NetServer/Services82/SoPrincipal/AuthenticateUsernamePassword"
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ApplicationToken xmlns:h="http://www.superoffice.net/ws/crm/NetServer/Services82">token</h:ApplicationToken>
</s:Header>
<s:Body>
<AuthenticateUsernamePassword xmlns="http://www.superoffice.net/ws/crm/NetServer/Services82">
<UserName>user</UserName>
<Password>password</Password>
</AuthenticateUsernamePassword>
</s:Body>
</s:Envelope>
So I guess the question is, how do I make sure that the authenticate SOAP request uses the Services endpoint that the RemoteBaseURL indicates for every on-prem tenant our application is communicating with?