I need to use the ProjectWise SDK (not the pwps_dab module) to login using Bentley IMS authentication. The documentation indicates 'aaApi_LoginWithSecurityToken' is the function but I'm not sure how to acquire the 'security token'. Does anyone have a working example they can share?
I updated my post and took out the part about "you might have to login at least once with PW explorer". I tested this against another datasource where I added the federated user account, but did not log in to that datasource, I just ran my sample application and it logged in just fine.
However, if your application uses an account that has not logged into ProjectWise Explorer, then unless you manually created that user's working directory on the machine that you are connecting from, any file transfers (check out, copy out, etc.) that need the working directory will fail. FWIW, in my stand alone apps, I check to see if the user has a working directory defined as well as checking to make sure that it exits. If not, I do that in code.
Looking forward to hearing if this was your problem or not.
Dan WilliamsSolution ConsultantBentley Systems, IncorporatedPortland, OR, USA (Pacific Time UTC-08:00)
Unfortunately its still not working via the API:
I can login using pwps_dab "New-PWLogin -DatasourceName $DatasourceFullName -BentleyIMS" no issues. I'll keep testing and feedback. Enjoy the weekend.
Hi,I am also trying to login to ProjectWise using Bentley IMS. I am not getting any loginToken as "aaApi_GetRelyingPartyIdentifier(serverName, ref relyingParty)" returns false. Hence, login is unsuccessful. Please help!Thanks.
My apologies for the delay, but I have a working sample up on github now. https://github.com/DanWilliamsAtBentleyDotCom/Sample-Login-With-Security-Token
Please give it a try and let me know if it worked or what specific problems you are having when you run a debugger against the code.
I used Visual Studio 2015, ProjectWise v10.00.03.140, ProjectWise SDK v10.00.03.140, CONNECTION Client v10.00.18.13 and tested against two different datasources using two different IMS accounts.
Oh, and I'd like to point out that the cleverness of the class ConnectionClientToken.cs, is all Dave Brumbaugh's work! If you haven't done so yet, you can get his MostOfDavesClasses.cs (and supporting files) at https://github.com/DaveBrumbaugh
Answer Verified By: Matthew Howdill
Fantastic, the sample worked perfectly after updating the 'DatasourceName' variable. Thanks for all your help.