ProjectWise SDK - Bentley IMS Login

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? 

Parents
  • Hi Dan,

    While you are on the topic, are you able to advise similarly what PW API functions and example to achieve the IMS login in MS VBA?

    i have using the aaapi_login() and various PW API functions in VBA to connect to our locally deployed PW for some time using SSO.  But we are moving the PW to the cloud with federated login.  I just got a cloud datasource setup and trying to use the codes for locally deployed PW I have developed to test them with the cloud hosted PW by using aaapi_login3() instead, it can connect with manually entered PW logical account credentials but it doesn't work using IMS user credentials automatically (CONNECTION Client) which is main requirement, I also have trouble working out how to acquire and pass IMS user's GUID in the parameter.

    i came across this post that the aaapi_loginwithsecuritytoken() API may be used, similarly I have trouble trying to work out how to acquire and pass the parameters required e.g. SAML Security token XML format in VBA.

    Would you please advise if there are any VBA examples for PW cloud IMS login.  The PW wiki examples only show the old local deployed PW login methods.

    Thanks in advance.

    Dan

  • Hi

    When I execute the sample code Sample-Login-With-Security-Token-master I am getting the error as below image.

    Do I have to do anything extra? Thank you.

  • Thank you for your reply. I followed few step as mentioned in the following link Using Bentley IMS with ProjectWise and now I am able to run the sample code successfully as shown below.

    But I couldnt exactly get what it means by doing all these things. Is there any good source when it explains all these stuffs? Thank you again.

  • Well, I'm not sure if there is a "good source" for explaining "unknown, unknowns".  There is documentation included with each product, and there are online sources for documentation, but there are always "assumptions" made by authors of any documentation (or software products!) on what the target audience already (or should) know.

    I too, like many others, struggle to "keep up" with the latest features and offerings, so I can understand (and relate) to your frustrations of "not understanding" some particular topic/feature/issue/etc.  All I can offer is encouragement, and ideally, answers to specific questions.

    If you need help, you are doing the "right thing", i.e. searching as best you can for an answer, and then by posting your questions on Bentley Communities!

  • Hi , this is the C++ code for login using IMS

    BOOL bRet;
    LPWSTR pwszRelayingPart;
    bRet = aaApi_GetRelyingPartyIdentifier(L"SVLU0341.SECUDE.local", &pwszRelayingPart); // I am not doing anything with this function.
    
    // The actual code begins here.
    LPWSTR pwszDelegatedSecurityToken;
    LPWSTR pwszUserName;
    bRet = aaApi_RetrieveSecurityToken(L"SVLU0341.SECUDE.local:BentleyPWDS", FALSE, &pwszDelegatedSecurityToken, &pwszUserName);
    
    bRet = aaApi_LoginWithSecurityToken(L"SVLU0341.SECUDE.local:BentleyPWDS", pwszDelegatedSecurityToken, FALSE, NULL, NULL);
    if (bRet)
    {
        aaApi_MessageBox(L"Login success", MB_OK);
    }

  • ,

    I'm not sure of the purpose of your last post.  Is there a question?  Or perhaps you just want to show your (now working) code for the benefit of others, which is always appreciated by the way!

    FWIW, I verified that your posted code works for one of the available datasources that I have access to.

    My only "negative" comment about your code would be that you are not checking the return values for failure, and of course, that means any failures go unreported, but that's OK for a "code snippet" as it makes it easier for folks to see the flow of the process and not get "distracted" by the error handling, etc.

    Take care!

  • Thank you . It is for both, "benefit of others" and also for "code review" if in case I might be missing something.

Reply Children
No Data