I am trying to connect to a customer server/datasource with credentials that were provided via the customer. I am able to login via ProjectWise Explorer with no issues. If I use the same exact Server/Datasource , username and password in the api aaApi_Login(), I get the error 55515: Invalid user name and password combination
I have asked the customer if they are using any of the options in the dmskrnl.config, SSO, STS, DMS and I am waiting on a reply.
I added info level logging and saw the error 11-11-20 14:52:11.458 [21] TRACE - InternalAuthenticator - Internal Authenticator token invalid in the file BeLicSvc.Log around the time of test. My test program is below. I have tried both aaApi_Login() and aaApi_Login3() with same error results. Please let me know if you have any suggestions on:
- how to solve.
- how better to diagnose if not. Questions for the the customer server environment, better logging techniques.
Thanks in advance - Mandi
public bool Login(string user, string pass, string dsName, Action<string> log = null) { bool success = false;; try { ProjectWiseAPI.aaApi_Initialize(0); //AAMODULES_ALL ProjectWiseAPI.aaApi_InitializeModules(0); Guid userID = new Guid(); lock (_lockLogins) //lock until the login finishes. { log($"Logging in as {user}"); // success = ProjectWiseAPI.aaApi_Login3(0, dsName, user, pass, "", ref userID); success = ProjectWiseAPI.aaApi_Login(ProjectWiseAPI.DataSourceType.Unknown, dsName, user, pass, "", true); if (success) { _loggedIn = true; _user = user; _dsName = dsName; _dsType = -1; ProjectWiseAPI.aaApi_GetCurrentSession(ref _session); success = true; } else { int err = ProjectWiseAPI.aaApi_GetLastErrorId(); string msg = ProjectWiseAPI.aaApi_GetLastErrorMessage(); string det = ProjectWiseAPI.aaApi_GetLastErrorDetail(); log($"Logging error {err} - {msg} - {det}"); } } } catch (Exception ex) { log(ex.ToString()); } return success; }
Try passing null for the schema instead of an empty string.
Thanks Brian! I tried this, unfortunately I get the same error.
Be sure your password is NOT a secure string. It must be in clear text. If you are passing in a secure string, you can use something like this Password.ConvertToUnsecureString() to convert it.
Thank you again, it is not a secure string.
Solved! For all that might run in to this in the future: The username had a '@' symbol in it which for some reason is allowed via ProjectWise Explorer Client, but not via the API. When the '@' was replaced with a dash, the login was successful.
Answer Verified By: Mandi Bishop