Hey all,
Has anyone ever encountered intermittent failures when logging in to datasources via the API with SSO? We've switched to using SSO vs a logical account to log in with some of our C# Windows Services code. Most of the time, the login works just fine. However, what we are seeing is that sometimes logins fail, with the following message
58063 Cannot login to the datasource Invalid user name and password combination.
We've constructed a testing service that reproduces the problem. The login psuedo code in the test program looks like this:
aaApi_Initialize(0); aaApi_SetModuleFlags(AAMODULEF_NON_UI_MODE); aaApi_SetErrorLogFile("logfile.txt", false); if (!(aaApi_AdminLogin(0, PWDataSource, null, null))) { string errmsg = PWInterface.GetLastErrorDetail(); WriteToFile("[PWService] - " + errmsg); Debug.WriteLine("[PWService] - " + errmsg); } else { Debug.WriteLine("[PWService] - Logged in OK"); WriteToFile("[PWService] - Logged in OK"); }
The login code will continue to fail until the service is restarted. This is the real problem as we have to intervene to get it to start working again.
Has anyone else run into this? Is there a way to get more debugging information out of the API? The information logged to the error file specified in aaApi_SetErrorLogFile isn't very helpful. I can't see anything in the API that would control the logging level.
The only time I have seen that is when the user account is disabled. The logging level is controlled by the ProjectWise Explorer module. The client side logging XML file can be found in the BIN folder. You can turn up the logging there. The log files are usually under c:\ProgramData\bentley\... the XML file should tell you where with some environment variable examination.
Thanks Dean. I think we figured out that we didn't have the "Prevent UDP" feature enabled on our client settings. Because of this, our client would sometimes communicate with a gateway server that didn't have SSO enabled. I've checked that box and my testing has gone better thus far.