Unable to authenticate due to javascript popup

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

Unable to authenticate due to javascript popup

L2 Linker

Hi, i created a new Connection Component based on PSM-WebAppSample for Xerox CentreWare Web.

 

Impossible for me to fill the good "Form Fields" with the correct values : i have to fill a POPUP (Javascript ?) and impossible to catch fields ID, Name or XPath.

 

How can i do ?

 

Thx for your help

 

 

9 REPLIES 9

L4 Transporter

Could you please provide the screenshot with popup?

L2 Linker

Hello. How can i do that ?

You can run the web-browser on the PSM server itself and navigate the web-site, then take screenshot of a pop-up that you are writing about.

Hello

 

If i run the web page on the PSM, i receive this page :

 

Field_Content_versions_oct20__0682J000009naelQAA.png

If i click after on Administration, a popup appears :

 

Field_Content_versions_oct20__0682J000009nafUQAQ.png

 

But it's possible to have automatically this authentication form using this URL:

Field_Content_versions_oct20__0682J000009nagDQAQ.png

 

How to fill in ?

 

Thanks for your help

 

 

 

L4 Transporter

You can do it in 3 different ways, maybe more, but I know only those.1st method is the easiest, so I will describe it here with additional details, if you need details for the other methods, then let me know, they are more heavy and I will have to put some example codes on GitHub.

1. By embedding credential directly into the connection string and command line. But in this case your account that you are using should have correct username and password and you cannot use logon account. For this please use "CyberArk Endpoint Privilege Manager (EPM) - AD" connection component from Marketplace as example. The principle for you is the same, just URL address is different. Let me know, if you need some additional explanation there. Basically you can even run this command from your computer or from PSM server to see if that works:

C:\Program Files (x86)\Google\Chrome\Application\chrome.exe https://{Username}:{Password}@{Address}

 

Replace {Username}:{Password}@{Address} with your values, for example, notice "" quotes around chrome address, don't put them in your connection component settings, you need them when running from CMD:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" https://MyUsername:[email protected]/Xerox...

Also with this scenario pay attention to a special characters in your password, certain character might cause issues.

2. By first running AutoIt script and then in this script embedding credentials, it is like in 1st method, but here you can also in AutoIt retrieve logon account credentials and use use them in a command, when running Chrome.

3. By running AutoIt script with special UIAWrappers.au3 module that can also parse this Sign-In window, which is by default not possible in AutoIt. This is, by the way, the most secure way, because credentials are not embedded in the command, like in previous 2 examples, and cannot be visible via ProcessExplorer from SysInternals.

 

Regards

Hello

 

I started using AutoIt... So here's my base :

 

Field_Content_versions_oct20__0682J000009nzxXQAQ.png

 

 I suppose i've just to add $TargerUsername and $TargetPassword in the $CLIENT_EXECUTABLE parameter ?

 

I tried this on the PSM :

$ConnectionClientPID = Run($CLIENT_EXECUTABLE & " https://" & $TargetUsername & ":" & $TargetPassword & "@MyURL")

CHROME is starting, but MyURL doesn't start...

 

 What about the SSL : How can i force EnforceCertificateValidation to NO ?

 

 

Hi @Cedric BOREUX​ ,

I think there is an error at "@MyURL" it is not being correctly resolved.

Also you don't need all those ControlSend commands, because you are already embedding credentials in your URL.

Here is example AutoIt code to run web-browser:

; Run Chrome with specified user in URL and exit Local $_Program = '"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ' & 'https://' & $g_pTargetUsername & ':' & $g_pTargetPassword & '@' & $g_pTargetAddress & ' --no-default-browser-check' Local $_WorkingDir = "" LogWrite("Running Chrome") ; Note for the code below: $_PID is not the PID we need to pass to PSM, because it will not give the PID of Chrome window. You need to do it separately, if you need it, but this will increase complexity of the program, so let me know, if you need example for getting the PID of the Chrome. Local $_PID = Run($_Program, $_WorkingDir, @SW_MAXIMIZE) AssertErrorLevel(@error, "Failed to run program.", -1002)

Also you can play with different Chrome run options, most interesting are described in the example code below, this also answers your question about certificates validation:

Global Const $g_pUniqueChromeProfileFolderName = "MyApplicationName" local $_Program = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ; Important note: --user-data-dir= parameter should be defined when running Chrome, ; otherwise it is not possible to run several chrome browsers by one user in different PSM sessions ; I decided to use addrees field (IP address or dns name) of the fortigate for this. ; Note: user data data dir parameter should be really unique ; that is why I also add user name parameter, because otherwise it is not possible to run 2 sessions to the same fortigate using different users Local $_UserDataDir = EnvGet("USERPROFILE") & "\ChromeProfiles\" & $g_pUniqueChromeProfileFolderName & "\" & $g_pTargetAddress & "_" & $g_pTargetUsername ; Note: I decided to skip certificate check for this, because we access the management inteface via IP, that is why we will alway get certificate error page ; --test-type option is required to skip next message "you are using an unsupported command-line flag ignore-certificate-errors" ; Note: we need to use --force-renderer-accessibility to be able to access chrome UI via API local $_Arguments = "--new-window " & $_URL & " --no-default-browser-check --no-first-run --start-maximized --ignore-certificate-errors --test-type --force-renderer-accessibility --disable-save-password-bubble --user-data-dir=" & $_UserDataDir local $_ProgramWithArguments = $_Program & " " & $_Arguments local $_PID = Run($_ProgramWithArguments, "") AssertErrorLevel(@error, "Error Failed to run Chrome.", -1004)

Hope this helps, let me know, if you have other questions.

@Cedric BOREUX​  Can you help me with complete script at - [email protected]

 

Thankyou,

L1 Bithead

Hello,

This happens because the web browser is being launched as the shadow user and not a domain user when trying to go a website which has SSO authentication, typically through adfs. AutoIT would be a great work around, however autoIT is not allowed in all environments as it is open source and not supported.

we encountered this and we found out there is a windows setting where "windows authentication" is being selected first. if that setting is removed, msForms will be the default authentication method. rather than a pop up appearing, the website will redirect to a msForms url which has fields you can scrape the html elements off. add those fields to the webform settings then it should work.

 

by disabling windows authentication, any non privileged account which use sso/adfs will prob have to be routed through cyberark.

  • 1091 Views
  • 9 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!