PSM web integrations: is it possible to make conditional webform entries

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

PSM web integrations: is it possible to make conditional webform entries

L4 Transporter

I see an added demand in our organisation to add web portals via PSM connectors.

 

however, as I do not want to make a dedicated connection component for every type of portal, I am wondering if it is possible to make conditional statements in the webform.

 

I see several portals using a form to input credentials and submit by clicking a button.

there are only few differentiations like:

 

for instance in different login forms:

"id=username" vs "id=email" vs "name=enter name"

or button is represented as

"id=loginButton" vs "id=submit"

 

now I have something like this in my webform:

username>{Username}

password>{Password}

loginButton>(Button)

 

in above example I like to do something like:

if "username" or "email" is found (as id/type/name), then enter {username}

 

 

in this way I can make one connection component that is capable of handling more than one type of portal.

The documentation is not clear in this for me.

1 accepted solution

Accepted Solutions

L7 Applicator

With Xpath selectors you can write a selector that matches one of multiple possible elements on the page.

For example, your scenario with 2 differently named buttons, could be represented as:

//button[@id="loginButton" or @id="submit"] > (Button)(SearchBy=Xpath)

Selenium will click the first element it finds. You can even reference an object which is not clickable (like a heading), which will then act as a fallback, so CPM/PSM doesn't throw an error if the first element is not found.

 

View solution in original post

7 REPLIES 7

L6 Presenter

HI @Arie Hoogendoorn​ ,

 

you have to consider the two aspects in managing an account: the login and, more importantly, the Password.

 

It becomes really complicated to create a single component that can handle the two aspects. If you are referring exclusively to the connection you could try to implement a custom connection component with Autoit but I strongly advise against it.

 

CyberArk provides the Plugin Generator Utility to facilitate these activities.

 

Nino

L7 Applicator

With Xpath selectors you can write a selector that matches one of multiple possible elements on the page.

For example, your scenario with 2 differently named buttons, could be represented as:

//button[@id="loginButton" or @id="submit"] > (Button)(SearchBy=Xpath)

Selenium will click the first element it finds. You can even reference an object which is not clickable (like a heading), which will then act as a fallback, so CPM/PSM doesn't throw an error if the first element is not found.

 

And also there is an improved version of the PSM/CPM web apps plugin framework in development at CyberArk, which will actually allow you to use if-else scenarios and more complex conditionals, similarly to the one described in the original question.

that sounds really interesting.....but at this moment in time cannot wait for that 😉

your initial answer was exactly what I needed. going to experiment with it.

L4 Transporter

@Bernhard Brückler​ 

with your answer I got a bit further....already able to logon on three distict (small different elements) portals.

However, now I think I have a situation that does somehow not map with the clicking.

 

following is now in the webform:

//*^[@id="Log_On" or @id="loginButton" or type="submit"^]>(Button)(searchby=xpath)

 

I think because of the element difference this does not work. (input vs button element?)

Do you or someone else know an alternative?

 

working click element poral1

<input type="submit" id="Log_On" value="Aanmelden" class="custombutton login_page">

 

non working click element portal2

<button type="submit" class="btn btn-raised btn-primary pull-right">Aanmelden</button>

 

"type" needs to have an @ before it.

 

If you quickly want to test if an Xpath selector is working, you can open Chrome (on the CPM or your workstation, but not on PSM because the hardening would get in your way), open the developer tools, go into the elements tab, and press Ctrl-F to search. In the search field, you can enter the Xpath selector (for example: //*[@id="Log_On" or @id="loginButton" or @type="submit"]) and Chrome should highlight all matching elements.

😅 why didn't I/we see this....Thanks for this new tip.

  • 1 accepted solution
  • 1029 Views
  • 7 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!